07 - collectionView滚到indexPath指定Cell

来源:互联网 发布:综合基础知考什么 编辑:程序博客网 时间:2024/04/29 22:00

error: collectionView滚到indexPath指定Cell 程序崩溃

NSInvalidArgumentException' : attempt to scroll to invalid index path

objective-c 实现

 [self.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:Left                              animated:NO];

swift 实现

collectionView.scrollToItemAtIndexPath(indexPath!, atScrollPosition: .Left,animated: false)

fix - BUG: 检查collectionView有无设置完毕(检查代码顺序)

简书地址:http://www.jianshu.com/users/227bbeb09f91/latest_articles

0 2