我通过在App Delegate文件中应用以下内容全局更新了tabBarItems的颜色:
UITabBar.appearance().tintColor = .black
是否可以执行相同操作但将更改应用于navBarButton项目?我找到的解决方案适用于iOS 4或5.
答案 0 :(得分:1)
要全局更改后缀,请在AppDelegate
didFinishLaunchingWithOptions
中更改
var navigationBarAppearace = UINavigationBar.appearance()
navigationBarAppearace.tintColor = UIColor.black
navigationBarAppearace.barTintColor = UIColor.blue
// Item title color
navigationBarAppearace.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.white]