[英]UICollectionView Bring Item to center position
SOL 1: SOL 1:
collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .centeredHorizontally, animated: true)
SOL 2: I suggest you add empty items at the beginning and end. SOL 2:我建议你在开头和结尾添加空白项目。 So the user can scroll the first and last visible item to the centre. 因此,用户可以将第一个和最后一个可见项滚动到中心。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.