gpt4 book ai didi

Swift 3 macOS,设置默认按钮样式

转载 作者:行者123 更新时间:2023-11-30 11:56:59 25 4
gpt4 key购买 nike

当我创建一个新的NSButton时,如何将其样式设置为默认样式?

let (nomplusbut) = NSButton(frame: CGRect(x: 200, y: iy, width: 300, height: 40))
(nomplusbut).title = "Pfad öffnen..."
(nomplusbut).target = (self, action: #selector(buttonAction)) as AnyObject?
(nomplusbut).isBordered = true
(nomplusbut).setButtonType(NSMomentaryPushInButton)

arraybut.append(nomplusbut)

print(array[array.count - 1].stringValue)
self.view.addSubview(arraybut[arraybut.count - 1])

我想要的风格:

button with default style

当前风格:

button with current style

最佳答案

您应该将按钮的 bezelStyle 更改为 rounded,例如:

nomplusbut.bezelStyle = .rounded

关于Swift 3 macOS,设置默认按钮样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47697846/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com