0
点赞
收藏
分享

微信扫一扫

ios开发之--tableview刷新某一个区和某一行

蒸熟的土豆 2023-08-22 阅读 7

在开发中,有时候,我们不需要刷新整个表,只需要刷新局部数据即可,具体代码如下:

//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];

这里仅做记录!




举报

相关推荐

0 条评论