[TIMOB-12656] Android: Scrollview content does not show when added in an 'open' event listener
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-02-09T01:01:40.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Allen Yeung |
Assignee | Ingo Muschenetz |
Created | 2013-02-09T00:55:03.000+0000 |
Updated | 2017-03-13T18:24:15.000+0000 |
Description
Reproduction Steps:
1. Run the code:
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
win.open();
function testscroll() {
var scrollView = Ti.UI.createScrollView({
contentHeight : 'auto'
});
var view2 = Ti.UI.createView({
height : Ti.UI.SIZE,
layout : 'vertical',
top : 0
});
for (var i = 0; i < 20; i++) {
var label = Ti.UI.createLabel({
height : 50,
text : 'Hello'
});
view2.add(label);
}
scrollView.add(view2);
win.add(scrollView);
}
win.addEventListener('open', function() {
testscroll();
});
Expected Result:
There should be a list of 'Hello' labels
Actual Result:
The screen is white without any labels.
NOTE: If you call the testscroll() outside of the event listener, this code will work.
Duplicate of TIMOB-12656
Closing ticket as duplicate.