插入UITableView行没有任何animation

[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; 

当我插入幻灯片后,每行都做这个。 我希望他们立即跳到新的地方。 我不想调用reloadData因为我的所有单元格都将被重绘。

是否有可能删除这个animation?

这适用于我:

 [UIView setAnimationsEnabled:NO]; [self.tableView beginUpdates]; [self.tableView insertRowsAtIndexPaths:indexPath withRowAnimation:UITableViewRowAnimationNone]; [self.tableView endUpdates]; [UIView setAnimationsEnabled:YES]; 

希望这可以帮助。

这也适用

 [UIView performWithoutAnimation:^{ [self.tableView insertRowsAtIndexPaths:indexPaths:withRowAnimation:UITableViewRowAnimationNone]; }); 

不幸的是,我遇到了同样的问题,我无法删除animation。

必须是UITableViewRowAnimationNoneanimationtypes的错误,因为iOS(任何版本)似乎并不尊重它。

如果您更新UITableView的dataSource并调用[tableView reloadData]而不是手动插入行,则表将刷新而不显示任何animation。