tableView 刷新列表,使用reload/reloadRowsAtIndexPaths:出现界面闪动,怎么办?
最近在实现一个微信朋友圈动态展开收起的功能,展开收起时使用reload界面闪动厉害,后调整为使用reloadRowsAtIndexPaths,依然有闪动出现,又调整了两个地方解决:
1、出现闪动添加以下代码乱跳关掉高度估算
_tableView.estimatedRowHeight = 0;
_tableView.estimatedSectionFooterHeight = 0;
_tableViewestimatedSectionHeaderHeight = 0;
2、若是使用reloadRowsAtIndexPaths刷新可添加以下代码通过block关掉动画
[UIView performWithoutAnimation:^{
[weakself.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
}];