I have a scrollable view and each view contains a dashboard view. If I place a view in each dashboard item the views seem to become offset when you scroll between the dashboard views. I need to place a view in the dashboard item as I have an image and a couple of labels that need to be shown on the item. The more you scroll the more offset the view becomes. See images. I have sample code that will reproduce the issue as well. This happens in the simulator as well as the device. To reproduce you have to scroll over at least 2 or 3 views and then scroll back. For some reason the 3rd scroll view stays as it should.
Titanium Command-Line Interface, CLI version 3.4.2, Titanium SDK version 3.5.1.GA Copyright (c) 2012-2015, Appcelerator, Inc. All Rights Reserved. Please report bugs to http://jira.appcelerator.org/ 4/4/2015, 12:57:30 PM Operating System Name = Mac OS X Version = 10.10.2 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 0.12.2 npm Version = 2.7.4 Titanium CLI CLI Version = 3.4.2 Titanium SDK SDK Version = 3.5.1.GA Target Platform = iphone Plaform iOS 8.2 (happened on 8.1 as well) Titanium Studio, build: 3.4.1.201410281727
function FirstView() { var self = Ti.UI.createView({ backgroundColor:'#FFFFFF' }); var scrollableView = Ti.UI.createScrollableView({ top : 10, width : (Ti.Platform.displayCaps.getPlatformWidth()), views : createDashboardViews(), showPagingControl : true }); self.add(scrollableView); function createDashboardViews() { var viewArr = []; for (var arryIndex=0; arryIndex < 4; arryIndex++) { var dashboardViewContainer = Ti.UI.createView({}); var dashboardData = []; for (var i=0; i<4; i++){ var container = Ti.UI.createView({ borderColor : 'red', width : 50, height : 50 }); var item = Ti.UI.createDashboardItem({}); item.add(container); dashboardData.push(item); } var dashboard = Ti.UI.createDashboardView({ data: dashboardData, wobble: true }); dashboardViewContainer.add(dashboard); viewArr.push(dashboardViewContainer); } return viewArr; } return self; } module.exports = FirstView;
Image of scrollable view before scrolling
Image of the scrollable view after scrolling showing how the view in the dashboard item has offset