当我创建新的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])
我希望拥有的风格:
当前风格:
答案 0 :(得分:0)
您应该将按钮bezelStyle
更改为rounded
,例如:
nomplusbut.bezelStyle = .rounded