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) }