由于某些原因,当调用reloadData
时,我的UICollectionView
在可见单元格内部进行过渡动画。
据我所知,它不应该这样做,这就是我想要做的事情。
为什么集合视图会在重新加载数据时进行动画?我该如何停止它?
我最终将使用[UIView setAnimationsEnabled:YES/NO]
,但我希望能够不需要太多额外的代码来解决它。
由于某些原因,当调用reloadData
时,我的UICollectionView
在可见单元格内部进行过渡动画。
据我所知,它不应该这样做,这就是我想要做的事情。
为什么集合视图会在重新加载数据时进行动画?我该如何停止它?
我最终将使用[UIView setAnimationsEnabled:YES/NO]
,但我希望能够不需要太多额外的代码来解决它。
[UIView performWithoutAnimation:^{
[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
}];
performBatchUpdates:completion:
的updates
块内调用了reloadData
方法? - plusetAnimationsEnabled
方法,我会建议你使用[UIView performWithoutAnimation:^{}]
。 - pluperformBatch...
内使用它。由于我们仍然针对 iOS 6.0,无法使用performWithoutAnimation
(似乎没有任何效果)。 - Alex