UITableView的补充细胞动画 [英] UITableView add cell Animation

查看:138
本文介绍了UITableView的补充细胞动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何一个可以帮助我的UITableView 动画的问题。

Can any one help me out with UITableView animating issue.

在默认情况下,我们有删除单元格,并在的UITableView 重新排序细胞动画。

By default we have animation for deleting cell and reordering cells in UITableView.

我们能有动画添加单元格,如果是如何做到这一点。

Can we have animated adding cell, if so how to do it.

我已签出的 Three20 ,没没有得到如何叽叽喳喳做了桌下的我的资料>锐推展开动画

I have checked out Three20, did not not get how twitter has done the table expand animation under MyProfile>ReTweets.

要使用现有的动画的UITableView 来尝试没有 Three20 frameowrk,

Want to try it without Three20 frameowrk, using the existing animation in UITableView.

在这个家伙的任何帮助。

Any help on this guys.

由于提前,

推荐答案

您可以使用下面的方法的UITableView:

You can use the following UITableView method:

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation

与self.dataSource是一个可变的数组,你的表只含有1部分示例:

Example with self.dataSource being a mutable array and your table only having 1 section:

[self.dataSource addObject:@"New Item"];
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:[self.dataSource count]-1 inSection:0];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];

请注意:从数据源计数中减去1,因为NSIndexPath为零索引

Note: Subtracted 1 from datasource count since NSIndexPath is zero indexed.

这篇关于UITableView的补充细胞动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆