ios - 操作表文本始终为灰色(NSAttributedString.Key 不起作用)
问题描述
我正在使用带有一些文本显示的自定义操作表。使用 XCode 11.3 我不能使用 NSAttributedString.Key.foreground。以前更新之前可以用,现在没找到解决办法。
let attributedMessageText = NSMutableAttributedString(
string: description,
attributes: [
NSAttributedString.Key.paragraphStyle: paragraphStyle,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0),
NSAttributedString.Key.foregroundColor: UIColor.red
]
)
如果我想改变背景颜色,它也会变成灰色。也许有人已经面临这个问题?
解决方案
推荐阅读
- jquery - 我正在构建的 Wordpress 页面正在使我的 iPhone 崩溃
- python - 具有定义边缘的 Python 3 OpenCV 颜色对象检测
- python - 如何在 Python 中将日期时间文本转换为日期时间对象?
- git - 用于将特定文本(模式)移动到不同列的 Shell 命令
- c# - 如何将 linq 与聚合、连接和分组方式结合使用
- php - 使用 z-index 响应的 2 个导航栏未按预期工作
- c++ - C++ - thread_local 向量导致 join() 崩溃
- amazon-web-services - 由 DynamoDB 流触发的 AWS Lambda 函数的输出如何处理?
- sql-server - 如何将 Angular 2 应用程序中的 json 数据发布到本地 asp.net mvc webapi 服务?
- java - 找不到资源java