UICollectionView update a single cell

前端 未结 3 1781
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 05:03

I am attempting to update a single cell inside a UICollectionView, specifically I am just trying to update an image in that specific cell detonated by cel

3条回答
  •  鱼传尺愫
    2020-12-01 05:48

    Dinesh's answer is spot-on. But to avoid unwanted animations when reloading (aka "flashing") use:

    BOOL animationsEnabled = [UIView areAnimationsEnabled];
    [UIView setAnimationsEnabled:NO];
    [myCollectionView reloadItemsAtIndexPaths:myIndexPaths];
    [UIView setAnimationsEnabled:animationsEnabled];
    

提交回复
热议问题