UITableViewRowAnimation - 正在删除行但没有动画

时间:2016-03-02 09:31:11

标签: ios objective-c iphone uitableview cocoa-touch

我正在尝试像这样实施UITableViewRowAnimation

[self.AroundersTableView beginUpdates];
[self.Arounders removeObjectAtIndex:cellRowToDelete];
[self.AroundersTableView deleteRowsAtIndexPaths:indexPathesToDelete withRowAnimation:UITableViewRowAnimationFade];
[self.AroundersTableView endUpdates];

该行正在删除,但没有动画。

知道出了什么问题吗?

2 个答案:

答案 0 :(得分:0)

确保您拥有[UIView setAnimationsEnabled:YES];

另外,请查看UITableViewRowAnimationFade Not Working

答案 1 :(得分:0)

Try this,

[self.AroundersTableView beginUpdates]; 

[self.AroundersTableView deleteRowsAtIndexPaths:indexPathesToDelete withRowAnimation:UITableViewRowAnimationFade];

[self.Arounders removeObjectAtIndex:cellRowToDelete];

[self.AroundersTableView endUpdates];