Skip to content

Commit

Permalink
in iOS 11 the status bar the statusbar is sometimes translucent/white
Browse files Browse the repository at this point in the history
resolution:
* storyboard uncheck translucent navbar
* set navigation.view.backgroundColor with the desired color

fixing #7
  • Loading branch information
skofgar committed Aug 11, 2018
1 parent 03b86dc commit 47dc940
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 61 deletions.
9 changes: 8 additions & 1 deletion Example/KGFloatingDrawer-Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func drawerSettingsViewController() -> UIViewController {
let viewController = viewControllerForStoryboardId(kKGDrawerSettingsViewControllerStoryboardId)
setStatusBarBackgroundColor(for: viewController)
return viewController
}

Expand Down Expand Up @@ -120,6 +121,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
})
}

func setStatusBarBackgroundColor(for viewController: UIViewController) {
if let navigation = viewController as? UINavigationController {
navigation.view.backgroundColor = navigation.navigationBar.barTintColor // navController.navigationBar.backgroundColor ??
}
}

fileprivate var _centerViewController: UIViewController?
var centerViewController: UIViewController {
get {
Expand All @@ -135,9 +142,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
drawerViewController.centerViewController = newValue
}
}
setStatusBarBackgroundColor(for: newValue)
_centerViewController = newValue
}
}

}

Loading

0 comments on commit 47dc940

Please sign in to comment.