我正在使用 UICollectionsView insertItemsAtIndexPath 并且它非常烦人,以至于当我在 UICollectionView 上滚动然后它调用 insertItemsAtIndexPath 它与项目一起滑动。我希望这个插入是无缝的,只是将它附加到顶部而用户不知道某些东西已附加到顶部。我该怎么做?
最佳答案
我想你必须继承 UICollectionViewFlowLayout,然后在 - (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath
中返回 nil。这样,它将直接将其放置到最终位置,因此不应发生任何动画。
关于iphone - 使 UICollectionView 中的 insertItemsAtIndexPath 不设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14594763/