When views are added to another view which has width = Ti.UI.SIZE set, some of the child views are not displayed.
This worked correctly in 1.8.2.
See attached screenshot.
Steps to reproduce
Step 1: run the code below on 2.0.1.GA2
Step 2: notice that you can only see the red views that are fully on the screen
Step 3: scroll to the side and notice that the rest of the red views are not there
Step 4: replace Ti.UI.SIZE with 2000 and run it again
Step 5: notice that all of the red views are displayed as expected
Prove this is a regression;
Step 1: "width = 'auto'" in 1.8.2 is the same as "width = Ti.UI.SIZE" in 2.0.1 (they both shrink to the size of their children)
Step 2: in the code below comment out "width: Ti.UI.SIZE," and use "width: 'auto'," instead
Step 3: run this edited code with 1.8.2 and notice that all of the red views are displayed as expected (see screenshot)
var win = Ti.UI.createWindow({backgroundColor:'white'});
win.open();
var scrollView = Ti.UI.createScrollView({
contentWidth: 2000,
backgroundColor: 'black',
layout: 'horizontal'
});
win.add(scrollView);
var view1 = Ti.UI.createView({
backgroundColor: 'blue',
height: 400,
// for 2.0
width: Ti.UI.SIZE,
// for 1.8
// width: 'auto',
layout: 'horizontal'
});
scrollView.add(view1);
for(var i = 0, j = 20; i < j; i++){
view1.add(Ti.UI.createView({
backgroundColor: 'red',
width: 100,
height: 400,
left: 40
}));
}
Fixed by PR 2073 for TIMOB-8773 TIMOB-8775
Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK 2.1.0.v20120618154152 hash r7830c03d OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown
Reopening to update labels