美文网首页iOS 好东西
UITableview 刷新某一个cell 或 Section,

UITableview 刷新某一个cell 或 Section,

作者: 冉俊 | 来源:发表于2018-08-30 14:23 被阅读9次
//一个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]; 
// 获取cell
NSUInteger section = 0;
NSUInteger row = 0;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
UFPersonalCenterTableViewCell *centerCell = (UFPersonalCenterTableViewCell *)[self cellForRowAtIndexPath:indexPath];

相关文章

网友评论

    本文标题:UITableview 刷新某一个cell 或 Section,

    本文链接:https://www.haomeiwen.com/subject/htorwftx.html