用下面的可以避免屏幕跳动。
[UIView performWithoutAnimation:^{
[_tableView reloadSections:[NSIndexSet indexSetWithIndex:tag] withRowAnimation:UITableViewRowAnimationFade];
}];
另外reload的时候如果有多个section每个section不同的row个数,会有section跳动的情况。这是设置tableview的esrowheight=0就行,不让他预估行高
其他文章请查看个人博客:http://zhangqq166.cn/
本文介绍了一种避免在UITableView进行重载操作时屏幕出现闪烁和section跳跃的方法。通过使用UIView的performWithoutAnimation方法,可以有效防止屏幕闪烁。同时,若UITableView包含多个section且各section的row数量不同,设置tableview的estimatedRowHeight为0可以避免section的跳跃现象。
2万+

被折叠的 条评论
为什么被折叠?



