如何设置NSButton背景图片 [英] How to set NSButton background image
本文介绍了如何设置NSButton背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为NSButton设置背景图像?
How can I set a background image to NSButton ?
[_ myButton setImage:[NSImage imageNamed:@ foo.png]]] ;
这只会更改按钮中的图像图标,但是没有选择将backgroundimage设置为 UIButton
。
This will only change the image icon in the button, but there s no option to setbackgroundimage as UIButton
.
推荐答案
好吧,这就是我所追求的: http://osdir.com/ml/cocoa-dev/2010-06/msg00539.html
Ok this was what I was after : http://osdir.com/ml/cocoa-dev/2010-06/msg00539.html
设置图像(按名称)。将位置设置为仅图标,不显示文本
(位置按钮数组中从左数第二个选项),然后取消选中 bbordered的
。
Set the image (by name). Set the 'Position' to icon only, no text (second option from left in array of position buttons), and uncheck 'bordered'.
这篇关于如何设置NSButton背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文