iOS UITableview 刷新指定的某一个section或cell

iOS UITableview 刷新指定的某一个section或cell_第1张图片
beauty_face.jpg

对于tableView的刷新界面,最简单,最常用的就是

[self.tableView reloadData];

当进行cell上的编辑操作或者某个section的所有cell的reloadData操作,就没有必要全部raloadData,通常减少操作耗损,采用局部reloadData

  1. [Section reloadData]
\\ 类似单选题的多选一、某个section的headerView的大小自适应等,需要重新刷新或布局
NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:indexPath.section];   
[self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; 

2.[Cell reloadData];

// 多选题的当前cell的点击不影响其他cell, cell有textField,textView, button等可编辑点击变化的控件,需要重新刷新或布局 
// 一般不需要这一行
// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];    
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone]; 

你可能感兴趣的:(iOS UITableview 刷新指定的某一个section或cell)