【发布时间】:2014-06-03 11:14:50
【问题描述】:
在初始状态下,我的收藏视图在一个部分中有三个单元格:
cell1、cell2和cell3。在下一个状态下,第一个单元格更改为
cell1_bis。它具有相同的大小。
是否可以为这个更改设置动画
cell1 -> cell1_bis?
【问题讨论】:
标签: animation uicollectionview uicollectionviewcell uicollectionviewlayout
在初始状态下,我的收藏视图在一个部分中有三个单元格:cell1、cell2 和 cell3。
在下一个状态下,第一个单元格更改为cell1_bis。它具有相同的大小。
是否可以为这个更改设置动画
cell1 -> cell1_bis?
【问题讨论】:
标签: animation uicollectionview uicollectionviewcell uicollectionviewlayout
继续往下:
[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
}] ;
【讨论】: