From a3ce1e0aab5086b48a1fbefdaedf63e48daba313 Mon Sep 17 00:00:00 2001 From: SketchK Date: Sun, 19 Nov 2017 11:14:57 +0800 Subject: [PATCH] fix scroll postion bug --- Sources/FSPagerView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FSPagerView.swift b/Sources/FSPagerView.swift index 6e3af53..22a7e3e 100644 --- a/Sources/FSPagerView.swift +++ b/Sources/FSPagerView.swift @@ -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) }