主要是需要這個(gè):
UIView.performWithoutAnimation {//取消刷新動畫 }
swift方法:
UIView.performWithoutAnimation {//取消刷新動畫
self?.tableView.reloadSections([0], with: .none)
}
OC方法:
[UIView performWithoutAnimation:^{
NSInteger index = [self indexOfCellType:TNDCPlayHomeContentSectionTypeTagList];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:index] withRowAnimation:UITableViewRowAnimationNone];
}];
【拓展】
1.刷新某一行cell
//一個(gè)cell刷新
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
2.刷新某一組數(shù)據(jù)
//一個(gè)section刷新
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];