gpt4 book ai didi

ios - 类型 'NSAttributedStringKey'(又名 'NSString')没有成员 'foregroundColor'

转载 作者:行者123 更新时间:2023-11-28 19:27:46 26 4
gpt4 key购买 nike

下面是针对上述问题的代码行。此问题发生在 Swift 4.1 中。

let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes

最佳答案

我已经通过替换属性字符串的键解决了这个问题。

这是我更新后的代码:

let textAttributes = [NSForegroundColorAttributeName : UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes

关于ios - 类型 'NSAttributedStringKey'(又名 'NSString')没有成员 'foregroundColor',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50325873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com