ZLNavigationController.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // ZLNavigationController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/6/16.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class ZLNavigationController: O2BaseForRotateUINavViewController {
  10. override func viewDidLoad() {
  11. super.viewDidLoad()
  12. if #available(iOS 15.0, *) {
  13. let appearance = UINavigationBarAppearance.init()
  14. appearance.backgroundColor = navbar_barTint_color
  15. appearance.titleTextAttributes = [NSAttributedString.Key.font:navbar_text_font,NSAttributedString.Key.foregroundColor:navbar_tint_color]
  16. self.navigationBar.standardAppearance = appearance
  17. self.navigationBar.scrollEdgeAppearance = appearance
  18. }else {
  19. self.navigationBar.barTintColor = navbar_barTint_color
  20. self.navigationBar.titleTextAttributes = [NSAttributedString.Key.font:navbar_text_font,NSAttributedString.Key.foregroundColor:navbar_tint_color]
  21. }
  22. self.navigationBar.tintColor = navbar_tint_color
  23. self.navigationBar.isTranslucent = false
  24. self.toolbar.barTintColor = navbar_barTint_color
  25. self.toolbar.tintColor = navbar_tint_color
  26. self.toolbar.barStyle = .default
  27. }
  28. override func pushViewController(_ viewController: UIViewController, animated: Bool) {
  29. if viewControllers.count > 0 {
  30. viewController.hidesBottomBarWhenPushed = true
  31. }
  32. super.pushViewController(viewController, animated: animated)
  33. }
  34. override var preferredStatusBarStyle : UIStatusBarStyle {
  35. return .lightContent
  36. }
  37. // override func childViewControllerForStatusBarStyle() -> UIViewController? {
  38. // return self.topViewController
  39. // }
  40. }