|
@@ -151,11 +151,15 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
|
|
|
indexpaths.insert(indexpath)
|
|
|
}
|
|
|
|
|
|
- if indexpaths.count > 0 {
|
|
|
- self.collectionView.scrollToItems(at: indexpaths, scrollPosition: .centeredVertically)
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {//页面跳转进入时未直接滚动和选中
|
|
|
+ if indexpaths.count > 0 {
|
|
|
+ self.collectionView.scrollToItems(at: indexpaths, scrollPosition: .top)
|
|
|
+ }
|
|
|
+
|
|
|
+ self.isChangeIndexPaths = true
|
|
|
+ self.collectionView.selectionIndexPaths = indexpaths
|
|
|
+ self.isChangeIndexPaths = false
|
|
|
}
|
|
|
-
|
|
|
- self.collectionView.selectionIndexPaths = indexpaths
|
|
|
}
|
|
|
}
|
|
|
|