Eureka Forms:如何更改表格全局色调颜色
Eureka Forms: How to change form global tint colour
我正在使用 Eureka 在我的项目中实现一个简单的表单。表单在键盘上方的色调栏按钮中似乎有蓝色色调,我不确定如何更改它。
有没有办法让 "Done" 标签像我的其他 UI 一样变成绿色?
您可以通过
为所有 UIView 实例设置默认色调颜色
UIView.appearance().tintColor = .red
appearance() 是 UIAppearance 协议中的一个方法。 UIView 及其子类确认此协议。你也可以做
UIButton.appearance().tintColor = .green
在 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
}
整个应用程序的所有色调颜色都将更改为给定的颜色。
更新了 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"
这非常适合我:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
NavigationAccessoryView.appearance().tintColor = /* your color here */
}
我正在使用 Eureka 在我的项目中实现一个简单的表单。表单在键盘上方的色调栏按钮中似乎有蓝色色调,我不确定如何更改它。
有没有办法让 "Done" 标签像我的其他 UI 一样变成绿色?
您可以通过
为所有 UIView 实例设置默认色调颜色UIView.appearance().tintColor = .red
appearance() 是 UIAppearance 协议中的一个方法。 UIView 及其子类确认此协议。你也可以做
UIButton.appearance().tintColor = .green
在 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
}
整个应用程序的所有色调颜色都将更改为给定的颜色。
更新了 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"
这非常适合我:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
NavigationAccessoryView.appearance().tintColor = /* your color here */
}