iphone - 使 UICollectionView 中的 insertItemsAtIndexPath 不设置动画

标签 iphone ios objective-c ipad

我正在使用 UICollectionsView insertItemsAtIndexPath 并且它非常烦人,以至于当我在 UICollectionView 上滚动然后它调用 insertItemsAtIndexPath 它与项目一起滑动。我希望这个插入是无缝的,只是将它附加到顶部而用户不知道某些东西已附加到顶部。我该怎么做?

最佳答案

我想你必须继承 UICollectionViewFlowLayout,然后在 - (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath 中返回 nil。这样,它将直接将其放置到最终位置,因此不应发生任何动画。

关于iphone - 使 UICollectionView 中的 insertItemsAtIndexPath 不设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14594763/

相关文章:

iphone - Objective Flickr 照片上传错误

iphone - 在字符串文件中存储键/值对

ios - 拖动 uiview iOS

ios - (UIView *)在 View Controller 中进行hitTest?

objective-c - 带水平滚动的 PDF View

iphone - 为什么只有 viewWillAppear 在返回导航时被调用

ios - 如何在我的应用程序 iPhone 中通过 fbconnect 获取用户的 facebook 个人资料图片?

iphone - 如何使用 iPhone 追踪 friend 的行踪?

objective-c - Objective C 中方法语法和命名约定的混淆

ios - 如何将 textField 的 integerValue 放入数组中?