marinofaggiana 4 жил өмнө
parent
commit
83d0e82fed

+ 6 - 6
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -82,8 +82,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        self.navigationController?.navigationBar.prefersLargeTitles = true
-        
         if enableSearchBar {
             searchController = UISearchController(searchResultsController: nil)
             searchController?.searchResultsUpdater = self
@@ -162,16 +160,18 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
 
+        navigationController?.navigationBar.prefersLargeTitles = true
+        navigationController?.setNavigationBarHidden(false, animated: false)
+        self.navigationItem.title = titleCurrentFolder
+
+        appDelegate.activeViewController = self
+
         if serverUrl == "" {
             appDelegate.activeServerUrl = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
         } else {
             appDelegate.activeServerUrl = serverUrl
         }
         
-        appDelegate.activeViewController = self
-        
-        self.navigationItem.title = titleCurrentFolder
-                
         (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
         gridLayout.itemForLine = CGFloat(itemForLine)
         

+ 11 - 8
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -83,7 +83,7 @@ import PDFKit
         
         view.addSubview(pageView)
         
-        pageView.heightAnchor.constraint(equalToConstant: 30).isActive = true
+        pageView.heightAnchor.constraint(equalToConstant: 40).isActive = true
         pageViewWidthAnchor = pageView.widthAnchor.constraint(equalToConstant: 10)
         pageViewWidthAnchor?.isActive = true
         pageView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 7).isActive = true
@@ -113,11 +113,14 @@ import PDFKit
         }
     }
     
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        
-        navigationController?.navigationBar.topItem?.title = metadata.fileNameView
-    }
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+
+        self.navigationController?.navigationBar.prefersLargeTitles = true
+        self.navigationItem.title = metadata.fileNameView
+
+        appDelegate.activeViewController = self
+    }   
     
     //MARK: - NotificationCenter
     
@@ -149,7 +152,7 @@ import PDFKit
         
         if navigationController?.isNavigationBarHidden ?? false {
             
-            appDelegate.activeDetail.navigateControllerBarHidden(false)
+            navigationController?.setNavigationBarHidden(false, animated: false)
             pdfThumbnailView!.isHidden = false
             pdfView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
             
@@ -158,7 +161,7 @@ import PDFKit
             let point = recognizer.location(in: pdfView)
             if point.y > pdfView.frame.height - thumbnailViewHeight { return }
             
-            appDelegate.activeDetail.navigateControllerBarHidden(true)
+            navigationController?.setNavigationBarHidden(true, animated: false)
             pdfThumbnailView!.isHidden = true
             pdfView.backgroundColor = .black
         }