2017-12-07 9 views
0

新しいNSButtonを作成すると、そのスタイルをデフォルトのスタイルに設定するにはどうすればよいですか?Swift 3 macOS、デフォルトのボタンスタイルを設定

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

答えて

0

は、変更すべきボタンのbezelStyleroundedに、例えば:

nomplusbut.bezelStyle = .rounded 
+0

優秀、ありがとうございました! – pikkuez

関連する問題