UILabel highlighted color attributed string (Apple bug?)

I have a UILabel in a custom UITableViewCell . This label has an attributed string with multiple text colors/fonts. When the cell becomes highlighted, the attributed text in the label all becomes the same color. More specifically, the text all becomes the same color as the first character . The fonts do not change.

I think that this behavior has something to do with the highlighted and highlightedTextColor properties on UILabel . I've tested this by subclassing UILabel and overriding -(BOOL)highlighted; to always return NO . This seems to prevent the color change but I'd like to know if anyone can explain why this is happening and if there is a better solution (like one that doesn't involve subclassing UILabel).

链接地址: http://www.djcxy.com/p/81948.html

上一篇: LineBreakMode的错误

下一篇: UILabel突出显示颜色属性字符串(Apple bug?)