创建新的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])
我想要的样式:
当前风格:
最佳答案
您应将按钮的bezelStyle
更改为rounded
,例如:
nomplusbut.bezelStyle = .rounded
关于swift - Swift 3 macOS,设置默认按钮样式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47697846/