UI

iOS reloadRowsAtIndexPaths页面抖动问题

2018-06-12  本文已影响146人  Jessica124

当刷新cell的一行时,整个页面会有上下滚动一下的动画,让人很不爽。

[self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];

解决办法如下:

[UIView performWithoutAnimation:^{
    CGPoint loc = self.tableView.contentOffset;
    [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
    strongSelf.tableView.contentOffset = loc;
}];

感谢https://stackoverflow.com/questions/27891061/ios-how-to-reload-cell-at-indexpath-without-animation

上一篇 下一篇

猜你喜欢

热点阅读