problem
[Ti.UI.ListSection.setItems](
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ListSection-method-setItems) takes a second parameter on iOS that allows you to specify a [ListViewAnimationProperties](
http://docs.appcelerator.com/titanium/latest/#!/api/ListViewAnimationProperties) object. In this object one of the properties is *animated*. Setting *animated* to *false* for this parameter should prevent the items from animating down when they are added to the ListView. Despite setting animated to false, the items still animate.
expected
ListItems will be added but not animated when the 2nd parameter to setItems() is set like this
listSection.setItems(arrayOfItems, { animated: false });
test case
You'll notice when running this on iOS that no matter what the value of the object for the second parameter in setItems() the items will still animate down from the top when added.
var ctr = 0;
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var list = Ti.UI.createListView({
sections: [Ti.UI.createListSection()]
});
var button = Ti.UI.createButton({
title: 'click me'
});
button.addEventListener('click', function(e) {
ctr++;
var items = [];
for (var i = 0; i < ctr; i++) {
items.push({
properties: { title: ctr + ' rows' }
});
}
list.sections[0].setItems(items, {animated:false});
});
win.add(list);
win.add(button);
win.open();
The bug i still present in the latest 3.3 build and prevents from releasing our app. Can someone look up this bug?
Found out, that the Bug only appears, when the section is already added to the listView before the items are applied to it. Simple test case to fix the given workaround:
But i would still say it is a bug, because the animationProperties should always be considered. :-)
Now it is working properly . It looks , it is fixed in previous builds . It was reported long back .
Closing ticket as the issue cannot be reproduced and with reference to the previous comments.