ios tips

reloadRowsAtIndexPaths会闪一下解决方法

2021-01-07  本文已影响0人  Gyuanhang

使用单纯的reloadRowsAtIndexPaths刷新tableview高度会导致页面上下闪动。

解决方法:

把该代码包在UIView的无动画block方法里就可以解决。

[UIView performWithoutAnimation:^{

                    [weakSelf.tableView reloadRowsAtIndexPaths:[NSArrayarrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];

                }];

上一篇 下一篇

猜你喜欢

热点阅读