Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4128] scrollableView addView() first view does not to display until scrolled forward and back

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-05T22:40:43.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterPaul Dowsett
AssigneeIngo Muschenetz
Created2011-05-17T17:28:49.000+0000
Updated2017-06-05T22:40:43.000+0000

Description

See [this video](http://dl.dropbox.com/u/14392713/scrollableView-addView-issue.ogv) that shows the code below in action. The issue is that the first view is not displayed until the user scrolls forward and back one view. This behavior is *not* exhibited if the views are assigned to an array and then to the scrollableView via the views property.
Titanium.UI.setBackgroundColor('#000');

var win1 = Titanium.UI.createWindow({
    title:'Win 1',
    backgroundColor:'white'
});

var scrollView = Ti.UI.createScrollableView();

for (var i=0; i<4; i++){
  var thisView = Ti.UI.createView({
    backgroundColor:"blue"
  });
  var thisLabel = Ti.UI.createLabel({
    text: "this is label "+i,
    height:100,
    width:100
  });
  thisView.add(thisLabel);
  scrollView.addView(thisView);
}

win1.add(scrollView);

win1.open();

Comments

  1. Biju pm 2013-10-11

    The issue cannot reproduce with the release master 3.2.0 Tested with: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.2.0 Tested on Device: Samsung galaxy s duos Android version: 4.0.4

JSON Source