[TIMOB-8881] iOS: scrollView - contentWidth and contentHeight only respond to "auto" not Ti.UI.SIZE
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-29T16:39:13.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-11 Core |
Components | iOS |
Labels | core, module_scrollview, qe-testadded |
Reporter | Jon Alter |
Assignee | Neeraj Gupta |
Created | 2012-04-25T09:11:58.000+0000 |
Updated | 2012-07-09T15:59:35.000+0000 |
Description
scrollView.contentWidth only responds to "auto" and not Ti.UI.SIZE as you would expect with the composite layout changes.
This creates an inconsistent experience for developers.
Steps to reproduce:
Step 1: run the code below Step 2: notice that the contentWidth is set to "auto" and is resizing as it should Step 3: replace "auto" with Ti.UI.SIZE Step 4: run the code again Step 5: notice that the scrollView does not scroll. This means that the contentWidth does not resize as you would expect it to with Ti.UI.SIZE
var win = Ti.UI.createWindow({backgroundColor:'white'});
win.open();
var scrollView = Ti.UI.createScrollView({
contentWidth: 'auto',
// contentWidth: Ti.UI.SIZE,
backgroundColor: 'black',
layout: 'horizontal'
});
win.add(scrollView);
for(var i = 0, j = 20; i < j; i++){
scrollView.add(Ti.UI.createView({
backgroundColor: 'red',
width: 100,
height: 400,
left: 40
}));
}
Fixed by PR 2073
Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown