Browse Source

#2276

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
5c34bf5fdb
1 changed files with 12 additions and 0 deletions
  1. 12 0
      iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

+ 12 - 0
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -55,6 +55,12 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
     private var pdfThumbnailScrollViewWidthAnchor: NSLayoutConstraint?
     private var pageViewWidthAnchor: NSLayoutConstraint?
 
+    private var hideStatusBar: Bool = false {
+        didSet {
+            setNeedsStatusBarAppearanceUpdate()
+        }
+    }
+
     // MARK: - View Life Cycle
 
     required init?(coder aDecoder: NSCoder) {
@@ -238,6 +244,10 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
         })
     }
 
+    override var prefersStatusBarHidden: Bool {
+        return hideStatusBar
+    }
+
     deinit {
 
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterFavoriteFile), object: nil)
@@ -390,10 +400,12 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
 
         if navigationController?.isNavigationBarHidden ?? false {
             navigationController?.setNavigationBarHidden(false, animated: true)
+            self.hideStatusBar = false
             pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor)
 
         } else {
             navigationController?.setNavigationBarHidden(true, animated: true)
+            self.hideStatusBar = true
             pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.topAnchor)
         }