iOS 好东西

UITableview 刷新某一个cell 或 Section,

2018-08-30  本文已影响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];
上一篇 下一篇

猜你喜欢

热点阅读