【发布时间】:2017-08-21 10:00:45
【问题描述】:
我有水平 UICollectionView,我想将它重置为 X 位置。我尝试了以下操作:
let indexPath = IndexPath(row: 0, section: 1)
self.collectionView.scrollToItem(at: indexPath, at: UICollectionViewScrollPosition(rawValue: 0), animated: false)
然而它不起作用,我得到一个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'attempt to scroll to invalid index path: <NSIndexPath: 0x61000002d040> {length = 2, path = 1 - 0}'
如何滚动集合视图开始?
【问题讨论】:
标签: ios swift uicollectionview