UICollectionView 更新单个单元格 [英] UICollectionView update a single cell
问题描述
我正在尝试更新 UICollectionView
中的单个单元格,具体来说,我只是尝试更新由 cell.imageView
引爆的特定单元格中的图像.[self.collectionView reloadData]
并不是一个真正的选项,因为它使整个集合视图闪烁.[self.collectionView beginUpdates]
似乎不是 UICollectionView
中的东西.
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 cell.imageView
. [self.collectionView reloadData]
is not really an option because it makes the whole collection view flash. [self.collectionView beginUpdates]
is not a thing in a UICollectionView
it seems.
我知道我可以使用:
[self.collectionView performBatchUpdates:^{
//do something
} completion:nil];
我不确定在完成块中放什么来更新特定单元格的 imageView
.这一切都在 didSelectItemAtIndexPath
内完成.此外,我没有使用 NSFetchedResultsController
.有什么想法吗?
I am not exactly sure what to put inside a completion block to update that certain cell's imageView
. This is all being done inside of didSelectItemAtIndexPath
.Also I am not using NSFetchedResultsController
. Any ideas?
推荐答案
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths
这里是一种在你的 collectionView
这篇关于UICollectionView 更新单个单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!