0

我在 iOS6 中使用 NSAttributedString ,我似乎无法让它工作:

[attributedString addAttribute:NSBackgroundColorAttributeName
                           value:[UIColor yellowColor]
                           range:range];

NSBackgroundColorAttributeNameiOS6 是否支持此方法调用和支持?

编辑: 解决了。这是我这边的遗留问题。之前的 kct*(例如kctforegroundcolorattributename)字符串属性常量仍在使用中。这些阻止了新的 API 值被正确实现。

4

1 回答 1

0

您必须使用NSMutableAttributedString

于 2013-04-13T16:40:51.560 回答