ZLTabBarController.swift 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // ZLTabBarController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/6/16.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class ZLTabBarController:UITabBarController {
  10. private var currentIndex:Int = -1
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. tabBar.isTranslucent = false //设置标签不透明
  14. tabBar.barTintColor = toolbar_background_color
  15. let item = UITabBarItem.appearance()
  16. item.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:toolbar_text_color,NSAttributedString.Key.font:toolbar_text_font], for:UIControl.State())
  17. item.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:O2ThemeManager.color(for: "Base.base_color")!,NSAttributedString.Key.font:toolbar_text_font], for: .selected)
  18. }
  19. override var preferredStatusBarStyle : UIStatusBarStyle {
  20. return .lightContent
  21. }
  22. override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
  23. }
  24. }