热门搜索 :
考研考公
您的当前位置:首页正文

解决UICollectionView ReloadData闪一下

来源:东饰资讯网

方法一:

[UIView setAnimationsEnabled:NO];
 
[collectionView performBatchUpdates:^{
    [collectionView reloadData];
} completion:^(BOOL finished) {
    [UIView setAnimationsEnabled:YES];
}];

方法二:

[UIView animateWithDuration:0 animations:^{
    [collectionView performBatchUpdates:^{
        [collectionView reloadData];
    } completion:nil];
}];
Top