//tabbar图标颜色
UITabBar.appearance().tintColor = UIColor.themeBackgroundColor()
//NavigationBar背景色
UINavigationBar.appearance().barTintColor = UITabBar.appearance().tintColor
//NavigationBar图标颜色
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().isTranslucent = true
UINavigationBar.appearance().barStyle = .black
//NavigationBar标题颜色
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.white]
只要上面几句就可以设置tabbar和navigationbar的颜色了
网友评论