【发布时间】:2010-05-15 16:01:13
【问题描述】:
当用户按下“编辑”时,我有一个包含数据列表的 tableview
我在底部添加了一个额外的行,上面写着“添加新”
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];
NSArray *paths = [NSArray arrayWithObject:
[NSIndexPath indexPathForRow:1 inSection:0]];
if (editing)
{
[[self tableView] insertRowsAtIndexPaths:paths
withRowAnimation:UITableViewRowAnimationTop];
}
else {
[[self tableView] deleteRowsAtIndexPaths:paths
withRowAnimation:UITableViewRowAnimationTop];
}
}
当然还有带有动画的 UITableView 变换, 但奇怪的是我刚刚添加的行之前的行,其动画与其他所有不同。
所有行都执行“滑入”动画,但最后一个执行“淡入”动画。
我没有在倒数第二行(或任何其他行)设置任何动画,如果我没有添加新行,当我切换到编辑模式时,动画会正常滑入。
不知何故我找不到答案,我用手机上的联系人应用程序检查,当他们在编辑模式下添加新行时,它没有像我那样奇怪的动画。
任何帮助将不胜感激。 谢谢
【问题讨论】:
标签: uitableview editing