How to set data to a table view without animation?
I use table views to display asynchronly loaded data using setData
. Because the table view is already displayed, I see some animation and it seems that rows are inserted from top to bottom, each sliding down. Is there a way to omit that behavior? I want the data to be just there - without any animation. I tried the line below (guessed from the kitchen sink example) but the animaed
property has no effect.
tableView.setData(data,
{animationStyle: Titanium.UI.iPhone.RowAnimationStyle.NONE});
6 Answers
-
Still not working 1.3
in KitchenSink - iPad
main-tests.jsMainTests.detailWindow.animate({view:e.rowData.v,transition:Ti.UI.iPhone.AnimationStyle.NONE});
does'nt work. No view update!
-
I have the same problem. I think it is a bug. Devs, can you fix this?
-
See https://appcelerator.lighthouseapp.com/projects/32238/tickets/815-table-view-updates-and-animation; it sadly appears that it's working as-designed, meaning you're not supposed to be able to prevent the animation :(
-
i tested the code above in head (upcoming 1.4 release) and it works fine, no animation.
in 1.4, you can also pass a null data value too.
i updated Kitchen Sink to demonstrate this as well as re-loading w/o animation.
-
It was a bug fixed in 1.3.0; once I changed my API version to that it worked :)
-
This works:
tableview.setData(data,{animated:false});
I hope it is not too late…