简单粗暴直接上代码刷新刷新tableView的时候发现会闪屏,iOS11后的适配高度设置一下,简单粗暴直接上代码刷新
self.tableView.estimatedRowHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
[UIView performWithoutAnimation:^{
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:0];
[self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
}];
这篇博客介绍了在iOS11及以上版本中,如何通过设置tableView的estimatedRowHeight、estimatedSectionFooterHeight和estimatedSectionHeaderHeight为0来避免刷新时的闪屏现象。博主还提供了一段代码示例,使用UIView的performWithoutAnimation方法配合UITableViewRowAnimationNone避免了动画效果,从而实现了平滑刷新表格视图。
5734

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



