Browse Source

Merge branch 'develop_v1.2' of git.kdan.cc:Mac_PDF/PDF_Office into develop_v1.2

tangchao 1 year ago
parent
commit
c3ea686562

+ 21 - 16
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -266,26 +266,31 @@ extension KMHomeViewController {
         }
 
         var contentViewHeight = 0
-        if self.historyFileViewController.showMode == .Thumbnail {
-            if self.historyFileViewController.thumbnailSCrollView != nil {
-                var count = rightWidth/(226 + 32)
-                if count <= 0 {
-                    count = 1
+        if self.historyFileViewController.files.count > 0 {
+            if self.historyFileViewController.showMode == .Thumbnail {
+                if self.historyFileViewController.thumbnailSCrollView != nil {
+                    var count = rightWidth/(226 + 32)
+                    if count <= 0 {
+                        count = 1
+                    }
+                    var row = self.historyFileViewController.files.count/count
+                    if self.historyFileViewController.files.count%count > 0 {
+                        row += 1
+                    }
+                    let height2 = (248 + 16) * row
+                    contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
+                    self.rightBottonHeight.constant = CGFloat(height2) + 76
                 }
-                var row = self.historyFileViewController.files.count/count
-                if self.historyFileViewController.files.count%count > 0 {
-                    row += 1
+            } else {
+                if self.historyFileViewController.listScrollView != nil {
+                    let height2 = self.historyFileViewController.files.count * 72 + 32
+                    contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
+                    self.rightBottonHeight.constant = CGFloat(height2) + 76
                 }
-                let height2 = (248 + 16) * row
-                contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
-                self.rightBottonHeight.constant = CGFloat(height2) + 76
             }
         } else {
-            if self.historyFileViewController.listScrollView != nil {
-                let height2 = self.historyFileViewController.files.count * 72 + 32
-                contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
-                self.rightBottonHeight.constant = CGFloat(height2) + 76
-            }
+            contentViewHeight = Int(rect.height - self.rightTopBox.frame.height)
+            self.rightBottonHeight.constant = CGFloat(contentViewHeight)
         }
         if contentViewHeight < Int(rect.height) {
             contentViewHeight = Int(rect.height)