在WKWebView中更改完成按钮的颜色

问题描述 投票:1回答:1

我在appDelegate中使用此代码将我项目中导航栏的所有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)

但是我在WKWebView中的ToolBar的Done按钮也是白色的,我该如何改变颜色呢?

ios swift uibarbuttonitem wkwebview uitoolbar
1个回答
-2
投票
let BarButtonItemAppearance = UIBarButtonItem.appearance()
BarButtonItemAppearance.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor.blue], for: .normal)
© www.soinside.com 2019 - 2024. All rights reserved.