<分区>
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
在上面的代码中,如何让第二行在第一行的动画完成后执行?
我试过了...
[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
{
[self.tableView beginUpdates];
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
[self.tableView endUpdates];
}
[self.tableView endUpdates];
还有这个……
[self.tableView beginUpdates];
{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
}
[self.tableView endUpdates];
[self.tableView beginUpdates];
{
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
}
...但无论哪种方式,动画显然是同时发生的(并且在打开慢速动画时非常明显)。