答案 0 :(得分:3)
更新了Eureka 4.3.x
您应该在控制器中覆盖变量 customNavigationAccessoryView
override var customNavigationAccessoryView: (UIView & NavigationAccessory)? {
// The width might not be correctly defined yet: (Normally you can use UIScreen.main.bounds)
let navView = NavigationAccessoryView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 44.0))
navView.barTintColor = UIColor.MaterialColors.category3
navView.tintColor = UIColor.white
return navView
}
在这里,您要修复完成标签的颜色。 将NaviagtionAccessoryView实例替换为下面的navigationAccessoryView
navigationAccessoryView.tintColor = "Your Colour"
navigationAccessoryView.backgroundColor = "Your Colour"
navigationAccessoryView.doneButton.tintColor = "Your Colour"
答案 1 :(得分:0)
您可以通过以下方式为所有UIView实例设置默认的颜色:
UIView.appearance().tintColor = .red
appearance()是UIAppearance协议中的一种方法。 UIView及其子类对此协议进行了确认。您也可以
UIButton.appearance().tintColor = .green
答案 2 :(得分:0)
在AppDelegate中添加以下行
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
self.window?.tintColor = UIColor.black // You can set it to which color you want.
return true
}
整个应用程序的所有色调都会更改为给定的颜色。
答案 3 :(得分:0)
这完全适合我:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
NavigationAccessoryView.appearance().tintColor = /* your color here */
}