适用于iOS 6的核心文本背景颜色

时间:2013-04-12 06:15:49

标签: ios6 background-color core-text nsattributedstring

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

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

此方法是否在iOS6中支持并NSBackgroundColorAttributeName

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

1 个答案:

答案 0 :(得分:0)

您必须使用NSMutableAttributedString