How to scroll to a particluar index in collection view in swift

前端 未结 5 2174
再見小時候
再見小時候 2020-12-06 00:35

We have a collection view. I have made a calendar which shows dates horizontally & I scroll dates horizontally. Now on screen I see only 3-4 dates. Now I want to auto sc

5条回答
  •  失恋的感觉
    2020-12-06 01:32

    You can use this

    self.collectionView.scrollToItem(at:IndexPath(item: index, section: 0), at: .right, animated: false)
    

提交回复
热议问题