美文网首页iOS进阶指南程序员
UITableView的单个cell与单个section的刷新

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

作者: 诠释残缺 | 来源:发表于2016-05-23 10:07 被阅读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];

相关文章

网友评论

    本文标题:UITableView的单个cell与单个section的刷新

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