CollectionView move to next cell automatically swift

后端 未结 11 2386
耶瑟儿~
耶瑟儿~ 2021-01-31 21:05

I am trying to create horizontal slider like Flipkart. I am using collectionView with Horizontal scrolling and paging. Cell contains imageView. I am succeed in scrolling items h

11条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 21:33

    I suggest using the collection view method scrollToItem(at:at:animated:) rather than scrollRectToVisible. It saves you from having to do calculations to figure out what rectangle to expose. You can just specify an indexPath to which you want to scroll.

提交回复
热议问题