Ios 类型';NSAttributedStringKey';(aka';NSString';)没有成员';foregroundColor';
下面是上述问题的代码行。 此问题出现在Ios 类型';NSAttributedStringKey';(aka';NSString';)没有成员';foregroundColor';,ios,nsattributedstring,swift4.1,nsattributedstringkey,Ios,Nsattributedstring,Swift4.1,Nsattributedstringkey,下面是上述问题的代码行。 此问题出现在Swift 4.1中 let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white] navigationController?.navigationBar.titleTextAttributes = textAttributes 我已通过替换属性字符串的键修复了此问题 以下是我的更新代码: let textAttributes = [NSForegroundColorA
Swift 4.1
中
let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes
我已通过替换属性字符串的键修复了此问题 以下是我的更新代码:
let textAttributes = [NSForegroundColorAttributeName : UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes
我已通过替换属性字符串的键修复了此问题 以下是我的更新代码:
let textAttributes = [NSForegroundColorAttributeName : UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes