我正在爲tvOS創建應用程序。我試圖設置一個UIButton的顏色,但不知道如何得到我的權利。如何在Swift中設置UIButton類型的顏色:.system for tvOS
var buttonA: UIButton(type: .system)
var buttonB: UIButton(type: .system)
...
buttonA.backgroundColor = UIColor.green
buttonB.backgroundColor = UIColor.red
我很高興的結果,當按鈕處於焦點,但是當按鈕沒有焦點,我得到一個醜陋的結果。綠色按鈕有一個缺少角落半徑的彩色圖層。
如何正確顏色的按鈕?