【发布时间】:2018-02-15 04:33:40
【问题描述】:
我想选择并滚动到 collectionView 中的特定 indexPath 并使其居中。我发现了这些功能,但无法将它们组合起来:
collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionViewScrollPosition.centeredVertically)
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
collectionView.scrollToItem(at: indexPath, at: .centeredVertically, animated: true)
提前致谢。
【问题讨论】:
标签: ios swift swift3 uicollectionview uicollectionviewcell