swift 自定义导航栏颜色
func setNavigationApperance(){ //自定义导航栏颜色 [self.navigationController?.navigationBar.barTintColor = UIColor (red:232/255.0, green:77/255.0, blue:122/255.0 ,alpha:1)]; //修改左右item字体颜色 self.navigationController?.navigationBar.tintColor = UIColor.whiteColor() //修改导航栏标题字体大小和颜色 self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName :UIColor.whiteColor()] }
然后在
override func viewDidLoad()
里面调用即可,直接粘贴使用