IOS UITableView reload 刷新某一个cell 或 section

时间:2015-01-05 12:51:03   收藏:0   阅读:1397

通常刷新整个列表 我们都使用[self.tableView reloadData];

有的时候,有变化更新的只是某一行 row 或者是某个section 所以只更新这一行就好了

//一个section刷新
int section_index=10;//更新第11个sectioin
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section_index] withRowAnimation:UITableViewRowAnimationNone];
//一个cell刷新    
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];  //更新 第一个section的第4行  
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

 

原文:http://www.cnblogs.com/someonelikeyou/p/4203171.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!