Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6200] iOS: Table View setData Now Animates Rows In

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-05T14:29:15.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2011-46, Release 1.8.0.1
ComponentsiOS
Labelsmodule_tableview, qe-testadded
ReporterDawson Toth
AssigneeStephen Tramer
Created2011-11-16T08:18:32.000+0000
Updated2014-06-19T12:43:17.000+0000

Description

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();

Comments

  1. Dawson Toth 2011-11-16

    Added a demonstration video.
  2. Jeevan Takhar 2011-11-16

    Setting animationStyle to none has no effect either: {noformat} tableview.setData(data, {animationStyle: Ti.UI.iPhone.RowAnimationStyle.NONE}); {noformat}
  3. Michael Pettiford 2011-12-07

    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
  4. Dustin Hyde 2012-01-05

    Added label qe-testadded.

JSON Source