Scroll UICollectionView to bottom

前端 未结 13 922
梦毁少年i
梦毁少年i 2021-02-02 12:05

I would like to scroll the UICollectionView to the bottom so the last item is in the view. I have tried to use scrollToItemAtIndexPath but it does not seem to be working. I want

相关标签:
13条回答
  • 2021-02-02 13:03

    Swift 5 if with animation horizontally

    func scrollToIndex(index:Int) {
     self.collectionView?.scrollToItem(at: IndexPath(item: index, section: 0), at: .centeredHorizontally, animated: true)
    }
    
    
    0 讨论(0)
提交回复
热议问题