|
@@ -194,9 +194,12 @@ public extension MVBanner {
|
|
|
}
|
|
|
final func scrollToItem(at index: Int, animated: Bool) {
|
|
|
let indexPath = IndexPath(item: index, section: 0)
|
|
|
- self.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: animated)
|
|
|
- let page = self.realIndex(index: index)
|
|
|
- self.setCurrentPage(page)
|
|
|
+ UIView.animate(withDuration: 0.05, animations: { [weak self] in
|
|
|
+ self?.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: animated)
|
|
|
+ let page = self?.realIndex(index: index) ?? 0
|
|
|
+ self?.setCurrentPage(page)
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|