Problem
Calling setData on a table view after the window has opened now causes the rows to animate in to view. By "animate in to view", I mean that they initially start at 0 height, and then expand to their regular height over the course of approximately half a second.
Expected Behavior
The rows should appear without any animation, unless I were to somehow specify that I wanted an animation. The existing behavior, before some recent commit to 1.8.0.1, should be maintained.
Demonstration Video
http://www.youtube.com/watch?v=Q8bcT6JqdDE
How to Reproduce
Drop the following in an app.js, and run it in the simulator.
A couple of points to note:
- I was very explicit about the height, although this isn't necessary to see the new animation behavior. I wanted to demonstrate that the issue wasn't caused by automatic height calculations, but is behavior that we introduced only recently.
- If you setData outside of the 'open' event, you won't see the animation.
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var table = Ti.UI.createTableView({
rowHeight: 30
});
win.add(table);
win.addEventListener('open', function (evt) {
table.setData([
{ title: 'Row 1', height: 30 },
{ title: 'Row 2', height: 30 },
{ title: 'Row 3', height: 30 },
{ title: 'Row 4', height: 30 },
{ title: 'Row 5', height: 30 },
{ title: 'Row 6', height: 30 },
{ title: 'Row 7', height: 30 },
{ title: 'Row 8', height: 30 },
{ title: 'Row 9', height: 30 },
{ title: 'Row 10', height: 30 }
]);
});
win.open();
Added a demonstration video.
Setting animationStyle to none has no effect either: {noformat} tableview.setData(data, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.NONE}); {noformat}
Tested on Ti Studio 1.0.7.201112061404 Ti Mob SDK 1.8.0.1.v20111205011857 OSX Lion iPod Touch 4.3.5, iPhone 4S OS 5.0.1, iPad 2 OS 4.3.5, iPhone Simulator 5.0 Expected behavior of set data not animating is shown
Added label qe-testadded.