开发者

NSButton with an Image

开发者 https://www.devze.com 2023-04-09 18:49 出处:网络
I have a question. I have a button on my .xib and a background i开发者_高级运维mage. I set an image to my button through the attributes inspector, but when I run the program and press the button, this

I have a question. I have a button on my .xib and a background i开发者_高级运维mage. I set an image to my button through the attributes inspector, but when I run the program and press the button, this happens:

NSButton with an Image

If I don't press it, it looks fine. What's wrong?


This is controlled by the setHighlightsBy: property on the cell. It's probably set to NSChangeBackgroundCellMask by default. Try setting NSContentsCellMask (if you have an alternate 'pressed' image) or NSNoCellMask.

0

精彩评论

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