开发者

setBackgroundStyle on NSTextField with an Attributed String Value not working

OS X 10.7:

Whenever I try to setBackgroundStyle: on an NSTex开发者_StackOverflowtField's cell that has an Attributed String value, the background style is unmodified. If the NSTextField has just a String value, the background style setter works.

[myTextField cell] returns an object of type NSTextFieldCell in both cases, which inherits setBackgroundStyle: from NSCell.

Anyone have a suggestion on how I can get around this limitation? I know I could try to recreate it with attributes, but I may never be able to get it just right.

P.S. - NSBackgroundStyleLowered appears to override your cell's text color (makes mine white), whereas NSBackgroundStyleRaised does not.


IME, the NSAttributedString overrides the settings for the NSTextField.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜