fix iOS 15 status bar issue

This commit is contained in:
ryanzhao 2021-09-22 15:57:12 +10:00
parent 5ccb84bcf0
commit a169284c85
1 changed files with 13 additions and 4 deletions

View File

@ -36,10 +36,19 @@ class BaseVC : UIViewController {
internal func setUpNavBarStyle() {
guard let navigationBar = navigationController?.navigationBar else { return }
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationBar.shadowImage = UIImage()
navigationBar.isTranslucent = false
navigationBar.barTintColor = Colors.navigationBarBackground
if #available(iOS 13.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Colors.navigationBarBackground
appearance.shadowColor = .clear
navigationBar.standardAppearance = appearance;
navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance
} else {
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationBar.shadowImage = UIImage()
navigationBar.isTranslucent = false
navigationBar.barTintColor = Colors.navigationBarBackground
}
}
internal func setNavBarTitle(_ title: String, customFontSize: CGFloat? = nil) {