fix scroll postion bug
This commit is contained in:
parent
a84ed179c0
commit
a3ce1e0aab
|
|
@ -463,7 +463,7 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega
|
|||
@objc(selectItemAtIndex:animated:)
|
||||
open func selectItem(at index: Int, animated: Bool) {
|
||||
let indexPath = self.nearbyIndexPath(for: index)
|
||||
let scrollPosition: UICollectionViewScrollPosition = self.scrollDirection == .horizontal ? .centeredVertically : .centeredVertically
|
||||
let scrollPosition: UICollectionViewScrollPosition = self.scrollDirection == .horizontal ? .centeredHorizontally : .centeredVertically
|
||||
self.collectionView.selectItem(at: indexPath, animated: animated, scrollPosition: scrollPosition)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue