我正在使用自定义操作表并显示一些文本。使用XCode 11.3,我不能使用NSAttributedString.Key.foreground。它以前在更新前就可以使用,但现在找不到解决方案。
Screengrab with example of my problem
let attributedMessageText = NSMutableAttributedString(
string: description,
attributes: [
NSAttributedString.Key.paragraphStyle: paragraphStyle,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0),
NSAttributedString.Key.foregroundColor: UIColor.red
]
)
如果我尝试更改背景色,它也会变成灰色。也许有人已经遇到了这个问题?