iOS刷新tableView抖动问题

2020-07-29  本文已影响0人  华子1889

刷新tableview

[UIView performWithoutAnimation:^{
  [tableView beginUpdates];
  [tableView endUpdates];
}];

yykit中也有方法能刷新,传入一个要处理的block

@implementation UITableView (YYAdd)
- (void *)updateWithBlock:(void *(^)(UITableView *tableView))block {
  [self beginUpdates];
  block(self);
  [self endUpdates];
}

UICollectionView 刷新高度 抖动问题解决方法

[UIView setAnimationsEnabled:NO];
    [self.collectionView performBatchUpdates:^{
    [self.collectionView reloadInputViews];
} completion:^(BOOL finished) {
    [UIView setAnimationsEnabled:YES];
}];
上一篇 下一篇

猜你喜欢

热点阅读