UiCollectionView: Как оживить смену ячейки?
Вопрос
- .
-
в исходном состоянии, моя коллекция имеет три ячейки, в одном разделе:
cell1
,cell2
иcell3
. -
в следующем состоянии, первая клетка меняется и становится генеракодицетагкодом.Он имеет тот же размер.
Можно ли оживить это изменение
cell1_bis
?
Решение
Ответ
Продолжить этот путь:
[self.collectionView
performBatchUpdates:^
{
NSIndexPath * whereTheChangeIs = [NSIndexPath indexPathForItem:row
inSection:section] ;
[self.collectionView deleteItemsAtIndexPaths:@[whereTheChangeIs]] ;
[self.collectionView insertItemsAtIndexPaths:@[whereTheChangeIs]] ;
}
completion:^(BOOL finished)
{
// nothing
}] ;
.
Вопрос
К сожалению, следующее не работает.Ошибка?
[self.collectionView
performBatchUpdates:^
{
NSIndexPath * whereTheChangeIs = [NSIndexPath indexPathForItem:row
inSection:section] ;
[self.collectionView reloadItemsAtIndexPaths:@[whereTheChangeIs]] ;
}
completion:^(BOOL finished)
{
// nothing
}] ;
. Не связан с StackOverflow