Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12656] Android: Scrollview content does not show when added in an 'open' event listener

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2013-02-09T01:01:40.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterAllen Yeung
AssigneeIngo Muschenetz
Created2013-02-09T00:55:03.000+0000
Updated2017-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.

Comments

  1. Allen Yeung 2013-02-09

    Duplicate of TIMOB-12656
  2. Lee Morris 2017-03-13

    Closing ticket as duplicate.

JSON Source