【发布时间】:2013-06-27 18:12:22
【问题描述】:
我有一个使用流式布局的 UICollectionView。
最初它会在 iPad 屏幕上显示大约 5 X 5 的小单元。
我想要做的是平滑地更改为几乎全屏的单元格大小,单元格的布局更大,布局略有不同。
----------------
| |---| |---| |
| | | | | |
| |---| |---| |
| |
| |---| |---| |
| | | | | |
| |---| |---| |
----------------
transitions to..
----------------
| |---------| |
| | | |
| | | |
| | | |
| |---------| |
| |
| |---------| |
----------------
目前我使用布尔值showLarge,当用户点击时我将其设置为YES (didSelectItemAtIndexPath)
然后我重新加载数据。
self.showLarge = YES;
[self.collectionView reloadData];
在我的cellForItemAtIndexPath 中,我根据布尔值加载适当的单元格:
if (!self.showLarge)
{
SmallCell *smallCell ..
etc
return smallCell;
} else
{
LargeCell *smallCell ..
etc
return largeCell;
}
但是,这是一个突然的转变。
如何平滑地为新的自定义 UICollectionViewCell 制作动画?
【问题讨论】:
标签: ios objective-c uicollectionview uicollectionviewcell