Problem description
If scrollToItem has been called when there are no elements in the ListView, it is then impossible to add elements to the view.
Steps to reproduce
The following code shows the issue; after 2s an element is added, but it does not work. Removing the scrollToItem line fixes the issue.
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var listView = Ti.UI.createListView();
var section = Ti.UI.createListSection({
headerTitle : 'Fruits'
});
listView.sections = [section];
win.add(listView);
win.open();
setTimeout(function() {
Ti.API.info("Adding test1");
listView.scrollToItem(0, 0);
section.appendItems([{
properties : {
title : "test1"
}
}]);
}, 2000);
Issue exist with SDK 3.1.3, 3.2.0 but can't reproduce with SDK 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA iOS SDK: 7 iOS iPhone Simulator: 7
Verified with environment: Appcelerator Studio:3.4.0.201409101253 Sdk:3.4.0.v20140910235714 alloy:1.5.0-rc titanium:3.4.0-rc titanium-code-processor:1.1.1 acs:1.0.16 npm:1.3.2 OS:Maverick(10.9.4) xcode: Xcode6GMSeed Device:iPhone5c(v8.0) after 2s an element is added to ListView. Working as expected. Hence closing the issue