07 - collectionView滚到indexPath指定Cell

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Gilgamesho/article/details/51456503

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

猜你喜欢

转载自blog.csdn.net/Gilgamesho/article/details/51456503
07
今日推荐