简体   繁体   English

更改WKWebView中完成按钮的颜色

[英]Change color of done button in WKWebView

I use this code in appDelegate to change color of all UIBarButtonItem of my navigationBar in my project to white 我在appDelegate中使用此代码将项目中我的navigationBar的所有UIBarButtonItem的颜色更改为白色

let whiteAttr = [NSAttributedStringKey.font : UIFont(name: "OpenSans", size: 14)! ,NSAttributedStringKey.foregroundColor: UIColor.white]
UIBarButtonItem.appearance().setTitleTextAttributes(whiteAttr, for: .normal)
UIBarButtonItem.appearance().setTitleTextAttributes(whiteAttr, for: .highlighted)

But Done button of my ToolBar in WKWebView is also white, how can i change the color ? 但是我在WKWebView中的工具栏的“完成”按钮也是白色的,如何更改颜色?

let BarButtonItemAppearance = UIBarButtonItem.appearance()
BarButtonItemAppearance.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor.blue], for: .normal)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM