iOS进阶指南程序员

UITableView的单个cell与单个section的刷新

2016-05-23  本文已影响361人  诠释残缺

刷新UITableView上的单个cell

//获取需要刷新的cell所在位置
NSIndexPath * indexPath = [NSIndexPath indexPathForRow:0 inSection:1];
//刷新
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationAutomatic];

刷新UITableView上的单个section

//获取需要刷新的section所在位置
NSIndexSet * indexSet = [NSIndexSet indexSetWithIndex:2];
//刷新
[self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];

上一篇 下一篇

猜你喜欢

热点阅读