创建新的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])


我想要的样式:

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

当前风格:

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

最佳答案

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

nomplusbut.bezelStyle = .rounded

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

10-10 12:40