ソースを参照

improved UINavigationBarAppearance

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年 前
コミット
144009aab9

+ 5 - 0
iOSClient/Extensions/UINavigationController+Extension.swift

@@ -71,4 +71,9 @@ extension UINavigationController {
         scrollEdgeAppearance.shadowImage = UIImage()
         navigationBar.scrollEdgeAppearance = scrollEdgeAppearance
     }
+
+    func setMediaAppreance() {
+
+        setNavigationBarHidden(true, animated: false)
+    }
 }

+ 2 - 5
iOSClient/Media/NCMedia.swift

@@ -115,16 +115,13 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
 
         appDelegate.activeViewController = self
 
-        //
+        navigationController?.setMediaAppreance()
+
         NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDeleteFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterMoveFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(renameFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterRenameFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(uploadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadedFile), object: nil)
 
-        // hide nagigation controller
-        navigationController?.navigationBar.prefersLargeTitles = true
-        navigationController?.setNavigationBarHidden(true, animated: false)
-
         self.reloadDataSourceWithCompletion { _ in
             self.timerSearchNewMedia?.invalidate()
             self.timerSearchNewMedia = Timer.scheduledTimer(timeInterval: self.timeIntervalSearchNewMedia, target: self, selector: #selector(self.searchNewMediaTimer), userInfo: nil, repeats: false)