【发布时间】:2013-04-30 15:38:23
【问题描述】:
我有一个 iPad 应用程序,我在其中使用 UICollectionView,每个 UICollectionViewCell 只包含一个 UIImage。 目前我每页显示每 9 个 UIImages(3 行 * 3 列),我有几页。
我想使用 Pinch Gesture 缩放整个 UICollectionView 以增加/减少每页显示的行/列数,最好是在 Pinch 手势期间有漂亮的缩放动画!
目前,我在 UICollectionView 上添加了捏合手势。我捕获 Pinch Gesture 事件以使用比例因子计算行数/列数,如果它已更改,则我使用以下方法更新完整的 UICollectionView:
[_theCollectionView performBatchUpdates:^{
[_theCollectionView deleteSections:[NSIndexSet indexSetWithIndex:0]];
[_theCollectionView insertSections:[NSIndexSet indexSetWithIndex:0]];
} completion:nil];
它可以工作,但我在过渡期间没有流畅的动画。
有什么想法吗? UICollectionView 继承自 UIScrollView,是否有可能重新使用 UIScrollView 捏手势功能来达到我的目标?
【问题讨论】:
标签: ios uiscrollview zooming uicollectionview