使用代码(不是界面生成器)我需要创建一个 NSButton
看起来像一个图像。具体来说,我想使用 NSImageNameStopProgressFreestandingTemplate
我不需要它看起来像按钮,而是看起来像图像。这表示:
1. 没有“按下按钮”的外观
2.没有边框,按钮没有任何可见性
谢谢。
最佳答案
禁用 isBordered
let button = NSButton(
image: NSImage(named: NSImage.Name("plus"))!,
target: self,
action: #selector(onButtonPress)
)
button.isBordered = false
关于nstableview - 如何编码 NSButton 看起来就像图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4533759/