Problem Description
contentWidth seems to be broken. In 1.82 the 'views' added to scrollView would fall underneath each other create tiles going down the window. In 2.0.1 they extend past the desired 'contentWidth' of 320.
Actual Results
The views doesn't follow the contentWidth size.
Expected Results
The view should respect the contentWidth
Test Case
1. Create new mobile app
2. Paste this code:
var scrollView = Ti.UI.createScrollView({
contentWidth: 320,
contentHeight: 'auto',
layout: 'horizontal'
});
var things = [
'item1',
'item2',
'item3',
'item4',
'item5',
'item6' ];
for (var i = 0; i < things.length; i++) {
var view = Ti.UI.createView({
height: 90,
width: 140,
top: 10,
left: 10,
backgroundColor: '#CCC'
});
scrollView.add(view);
};
var win = Ti.UI.createWindow();
win.add(scrollView);
win.open();
3. Compile this with Mobile SDK 2.0.1
Extra info
If you test this with 1.8.2, works like a charm.
Q/A Discussion
http://developer.appcelerator.com/question/135543/scrollview--contentwidth--sdk-201
Adjusting sprint to reflect PR submission date
Updated test which also exercises autosizing functionality of the scrollview bounds when conjoined with horizontal and absolute contentWidth:
PR 2073
Closing issue Tested with Ti Studio build 2.1.0.201206131907 Ti Mobile SDK 2.1.0.v20120613210250 hash rc8ddb29e OSX Lion 10.7.3 iPhone 4S OS 5.1 Verified that the views are laid out as expected
Re-opening to edit label