我在使用这个 UITableView method 时遇到问题:
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
首先文档说:
animation: YES to animate the deletion of sections, otherwise NO.
但是参数动画其实是枚举UITableViewRowAnimation
类型,不是BOOL
!?
那么如何禁用动画呢?我试过 NO
和 UITableViewRowAnimationNone
。什么都不管用。部分删除始终是动画的。
我知道我可以改用[tableView reloadData]
。那会解决我的问题。我只是好奇这是否是一个已知问题,以及是否可以使用此 tableview 方法禁用动画。
谢谢!
最佳答案
这有点像 hack,但这摆脱了插入动画:
[UIView setAnimationsEnabled:NO];
[self.tableView insertRowsAtIndexPaths:insertedIndexPaths withRowAnimation:UITableViewRowAnimationNone];
[UIView setAnimationsEnabled:YES];
关于iphone - UITableView 中的错误(deleteSections :withRowAnimation: )?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6431806/