|
@@ -34,14 +34,33 @@ class NCMainNavigationController: UINavigationController {
|
|
|
}
|
|
|
|
|
|
@objc func changeTheming() {
|
|
|
-
|
|
|
- navigationBar.barStyle = .default
|
|
|
+
|
|
|
+ if #available(iOS 13.0, *) {
|
|
|
+
|
|
|
+ var navBarAppearance = UINavigationBarAppearance()
|
|
|
+
|
|
|
+ navBarAppearance.configureWithOpaqueBackground()
|
|
|
+ navBarAppearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
|
|
|
+ navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
|
|
|
+ navBarAppearance.shadowColor = .clear
|
|
|
+ navBarAppearance.shadowImage = UIImage()
|
|
|
+
|
|
|
+ navBarAppearance = UINavigationBarAppearance()
|
|
|
+
|
|
|
+ navBarAppearance.configureWithOpaqueBackground()
|
|
|
+ navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
|
|
|
+ navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
|
|
|
|
|
|
- navigationBar.backgroundColor = NCBrandColor.sharedInstance.backgroundView
|
|
|
- navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
|
|
|
+ navigationBar.scrollEdgeAppearance = navBarAppearance
|
|
|
+ navigationBar.standardAppearance = navBarAppearance
|
|
|
+
|
|
|
+ } else {
|
|
|
+ navigationBar.barStyle = .default
|
|
|
+ navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
|
|
|
+ navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
|
|
|
+ navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
|
|
|
+ }
|
|
|
navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
|
|
|
-
|
|
|
- navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
|
|
|
- navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
|
|
|
+ navigationBar.setNeedsLayout()
|
|
|
}
|
|
|
}
|