tableView刷新指定的cell 或section和滚动到指定的位置

Posted 会钓鱼的丶猫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tableView刷新指定的cell 或section和滚动到指定的位置相关的知识,希望对你有一定的参考价值。

转自:http://blog.csdn.net/tianyou_code/article/details/54426494

 

//一个section刷新      
  
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];      
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];      
  
//一个cell刷新      
  
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];      
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];    
  
  
// 滚动到指定位置  
 [self.tableView reloadData];  
 NSIndexPath * dayOne = [NSIndexPath indexPathForRow:0 inSection:2];  
[self.tableView scrollToRowAtIndexPath:dayOne atScrollPosition:UITableViewScrollPositionTop animated:YES]; 

 

以上是关于tableView刷新指定的cell 或section和滚动到指定的位置的主要内容,如果未能解决你的问题,请参考以下文章