ZLNormalNavViewController.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // ZLNormalNavViewController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2017/3/18.
  6. // Copyright © 2017年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class ZLNormalNavViewController: UINavigationController {
  10. override func viewDidLoad() {
  11. super.viewDidLoad()
  12. self.navigationBar.isTranslucent = false
  13. self.navigationBar.barTintColor = navbar_barTint_color
  14. self.navigationBar.tintColor = navbar_tint_color
  15. self.navigationBar.titleTextAttributes = [NSAttributedString.Key.font:navbar_text_font,NSAttributedString.Key.foregroundColor:navbar_tint_color]
  16. self.toolbar.barTintColor = navbar_barTint_color
  17. self.toolbar.tintColor = navbar_tint_color
  18. self.toolbar.barStyle = .default
  19. // //隐藏返回按钮文字
  20. let barItem = UIBarButtonItem.appearance()
  21. let offset = UIOffset(horizontal:0, vertical: 0)
  22. barItem.setBackButtonTitlePositionAdjustment(offset, for: .default)
  23. barItem.setTitleTextAttributes([NSAttributedString.Key.font:navbar_item_font,NSAttributedString.Key.foregroundColor:navbar_tint_color], for:UIControl.State())
  24. }
  25. override var preferredStatusBarStyle : UIStatusBarStyle {
  26. return .lightContent
  27. }
  28. }