Merge pull request #94 from SketchK/master
fix the bug of scroll position in selectItem function
This commit is contained in:
commit
eeadab14b3
|
|
@ -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