1.navigationBar的设置

let navColor = UIColor(red: 41/255, green: 160/255, blue: 230/255, alpha: 1)

func setNavibar() -> Void { self.navigationController?.navigationBar.barTintColor = navColor; self.navigationController?.navigationBar.tintColor = UIColor.white; self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white,NSAttributedStringKey.font:UIFont.boldSystemFont(ofSize:20)]; self.navigationItem.backBarButtonItem = UIBarButtonItem.init(title: "", style: .plain, target: nil, action: nil); }

 

2.tabbar 的设置

        self.tabBar.barTintColor=UIColor.gray;
        //.设置底部工具栏文字颜色(默认状态和选中状态)(选中状态为蓝色)
        UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object:UIColor.white, forKey:NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject], for:UIControlState.normal);
        UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object:UIColor.blue, forKey:NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject], for:UIControlState.selected)

 

tabbar 选中照片的颜色

    var image:UIImage = UIImage(named: imageName)!  
       var selectedimage:UIImage = UIImage(named: selectImageName)!;  
       image = image.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);  
       selectedimage = selectedimage.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);  
       vc.tabBarItem.image = image  
       vc.tabBarItem.selectedImage = selectedimage  

 

相关文章:

  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2021-06-06
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2021-05-29
相关资源
相似解决方案