diff --git a/MediaBrowser/MediaBrowser.swift b/MediaBrowser/MediaBrowser.swift index 0f3cb67..7b2d4cd 100755 --- a/MediaBrowser/MediaBrowser.swift +++ b/MediaBrowser/MediaBrowser.swift @@ -446,8 +446,7 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet self.rotating = false // Ensure nav bar isn't re-displayed if let navi = self.navigationController, self.areControlsHidden { - navi.isNavigationBarHidden = false - navi.navigationBar.alpha = 0 + navi.isNavigationBarHidden = true } } @@ -716,6 +715,15 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet if parent != nil && hasBelongedToViewController { fatalError("MediaBrowser Instance Reuse") } + + if let navBar = navigationController?.navigationBar, didSavePreviousStateOfNavBar, parent == nil { + navBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor:previousNavigationBarTextColor ?? UIColor.black] + navBar.backgroundColor = previousNavigationBarBackgroundColor + if previousNavigationBarTintColor != nil { + navBar.barTintColor = previousNavigationBarTintColor + } + navBar.tintColor = previousNavigationBarTextColor + } } /** @@ -1751,14 +1759,13 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet // Init grid controller gridController = MediaGridViewController() - if let gc = gridController, let navBar = navigationController?.navigationBar { + if let gc = gridController { let bounds = view.bounds - let naviHeight = navBar.frame.height + UIApplication.shared.statusBarFrame.height gc.initialContentOffset = currentGridContentOffset gc.browser = self gc.selectionMode = displaySelectionButtons - gc.view.frame = CGRect(x: 0.0, y: naviHeight, width: bounds.width, height: bounds.height - naviHeight) + gc.view.frame = CGRect(x: 0, y: 0, width: bounds.width, height: bounds.height) gc.view.alpha = 0.0 // Stop specific layout being triggered diff --git a/MediaBrowserDemo/ViewController.swift b/MediaBrowserDemo/ViewController.swift index 85b1610..a0ff737 100644 --- a/MediaBrowserDemo/ViewController.swift +++ b/MediaBrowserDemo/ViewController.swift @@ -27,8 +27,9 @@ class ViewController: UITableViewController { super.viewWillAppear(animated) navigationController?.navigationBar.tintColor = UIColor.black - + navigationController?.navigationBar.barTintColor = .white } + override func viewDidLoad() { super.viewDidLoad()