Browse Source

【2025】【BOTA】切换Tab后,缩略图选中状态没有了 - 修复

lizhe 3 weeks ago
parent
commit
dd31a58f49

+ 4 - 3
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailCollectionViewItem.swift

@@ -65,9 +65,10 @@ class KMNThumbnailCollectionViewItem: NSCollectionViewItem {
     
     override var isSelected: Bool{
         didSet {
-            cardFileView.properties.state = isSelected ? .pressed : .normal
-            
-            cardFileView.reloadData()
+            DispatchQueue.main.async { [weak self] in
+                self?.cardFileView.properties.state = self?.isSelected ?? false ? .pressed : .normal
+                self?.cardFileView.reloadData()
+            }
         }
     }
     

+ 1 - 1
PDF Office/PDF Master/KMClass/Left/KMNLeftSideViewController.swift

@@ -110,7 +110,7 @@ class KMNLeftSideViewController: KMNBaseViewController {
                 headerBox.contentView = thumbnailHeaderViewController.view
                 bottomBox.contentView = thumnailViewController?.view
                 self.view.layoutSubtreeIfNeeded()
-                reloadData()
+//                reloadData()
             case .bookmark:
                 headerBoxHeightConst.constant = 0