浏览代码

new view image

marinofaggiana 4 年之前
父节点
当前提交
7131b3243b
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

+ 3 - 4
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -139,8 +139,9 @@ class NCViewerImageZoom: UIViewController {
         imageViewLeadingConstraint.constant = xOffset
         imageViewTrailingConstraint.constant = xOffset
 
-        let contentHeight = yOffset * 2 + imageView.frame.height
         view.layoutIfNeeded()
+
+        let contentHeight = yOffset * 2 + imageView.frame.height
         scrollView.contentSize = CGSize(width: scrollView.contentSize.width, height: contentHeight)
     }
     
@@ -148,10 +149,8 @@ class NCViewerImageZoom: UIViewController {
         guard let image = image else { return }
         
         self.image = image
-        imageView.image = image
         imageView.frame = CGRect(x: imageView.frame.origin.x, y: imageView.frame.origin.y, width: image.size.width, height: image.size.height)
-        
-        self.view.setNeedsLayout()
+        imageView.image = image
     }
 }