【发布时间】:2020-11-10 05:44:13
【问题描述】:
我正在尝试使用我的 appDelegate 中的以下代码将标题栏文本更改为自定义的淡紫色阴影
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor(red: 0.9069682956, green: 0.7839415669, blue: 0.9612388015, alpha: 1)]
return true
}
但是标题栏文本仍然显示为黑色。有没有更好的方法来改变这种情况?
【问题讨论】: