marinofaggiana 5 년 전
부모
커밋
ad2539ef37
1개의 변경된 파일16개의 추가작업 그리고 1개의 파일을 삭제
  1. 16 1
      iOSClient/Main/NCDetailViewController.swift

+ 16 - 1
iOSClient/Main/NCDetailViewController.swift

@@ -28,7 +28,7 @@ import NCCommunication
 class NCDetailViewController: UIViewController {
 class NCDetailViewController: UIViewController {
     
     
     @IBOutlet weak var backgroundView: UIImageView!
     @IBOutlet weak var backgroundView: UIImageView!
-    
+
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
    
    
     @objc var isNavigationBarHidden = false
     @objc var isNavigationBarHidden = false
@@ -410,6 +410,13 @@ class NCDetailViewController: UIViewController {
         view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         
         
         backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brand.withAlphaComponent(0.4))
         backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brand.withAlphaComponent(0.4))
+        
+        // Standard Top Constraint
+        if #available(iOS 11, *) {
+            backgroundView.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true
+        } else {
+            backgroundView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
+        }
     }
     }
     
     
     //MARK: - View File
     //MARK: - View File
@@ -421,6 +428,13 @@ class NCDetailViewController: UIViewController {
         self.backgroundView.image = nil
         self.backgroundView.image = nil
         for view in backgroundView.subviews { view.removeFromSuperview() }
         for view in backgroundView.subviews { view.removeFromSuperview() }
 
 
+        // Standard Top Constraint
+        if #available(iOS 11, *) {
+            backgroundView.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true
+        } else {
+            backgroundView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
+        }
+        
         if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)) == false {
         if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)) == false {
             CCGraphics.createNewImage(from: metadata.fileNameView, ocId: metadata.ocId, filterGrayScale: false, typeFile: metadata.typeFile, writeImage: true)
             CCGraphics.createNewImage(from: metadata.fileNameView, ocId: metadata.ocId, filterGrayScale: false, typeFile: metadata.typeFile, writeImage: true)
         }
         }
@@ -433,6 +447,7 @@ class NCDetailViewController: UIViewController {
         // IMAGE VIDEO AUDIO
         // IMAGE VIDEO AUDIO
         if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_audio || metadata.typeFile == k_metadataTypeFile_video {
         if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_audio || metadata.typeFile == k_metadataTypeFile_video {
             
             
+            backgroundView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
             viewImage()
             viewImage()
             return
             return
         }
         }