marinofaggiana 4 年之前
父節點
當前提交
44ada31d16
共有 1 個文件被更改,包括 25 次插入8 次删除
  1. 25 8
      iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

+ 25 - 8
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -102,8 +102,11 @@ class NCViewerImageZoom: UIViewController {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        updateZoomScale()
-        centreConstraints()
+        if !detailView.isShow() {
+            
+            updateZoomScale()
+            centreConstraints()
+        }
         
         delegate?.willAppearImageZoom(viewerImageZoom: self, metadata: metadata)
     }
@@ -115,17 +118,31 @@ class NCViewerImageZoom: UIViewController {
         if view.bounds.width < view.bounds.height {
             heightMap = (view.bounds.width / 3)
         }
-    
-        detailView.update(metadata: metadata, image: image, heightMap: heightMap)
-        detailViewTopConstraint.constant = 0
-        detailView.hide()
         
-        updateZoomScale()
-        centreConstraints()
+        if !detailView.isShow() {
+            
+            detailView.update(metadata: metadata, image: image, heightMap: heightMap)
+            detailViewTopConstraint.constant = 0
+            detailView.hide()
+            
+            updateZoomScale()
+            centreConstraints()
+        }
         
         delegate?.didAppearImageZoom(viewerImageZoom: self, metadata: metadata)
     }
     
+    override func viewDidDisappear(_ animated: Bool) {
+        super.viewDidDisappear(animated)
+        
+        if detailView.isShow() {
+            
+            detailView.hide()
+            updateZoomScale()
+            centreConstraints()
+        }
+    }
+    
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()