tableviewcell的属性、方法、刷新

2017-04-06  本文已影响25人  张家杰仔
cell的添加属性,都应该加在 contentView  的属性上
如:
[self.contentView addSubview: self.label];

// 获取可以见到的 cell,让图片在cell坐标改变的时候偏移
 NSArray *array = [self.tableView visibleCells];

//刷新某一section
[self.tableview reloadSections:[NSIndexSet indexSetWithIndex:sender.tag - 100] withRowAnimation:UITableViewRowAnimationFade];
  

//一个cell刷新    
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

类别:
UITableViewStyleGrouped 时,section不会跟着移动
UITableViewStylePlain(默认) 时,section会跟着移动
上一篇下一篇

猜你喜欢

热点阅读