【发布时间】:2017-04-10 19:00:47
【问题描述】:
我正在为 tvOS 创建一个应用程序。我正在尝试设置 UIButton 的颜色,但不知道如何正确设置。
var buttonA: UIButton(type: .system)
var buttonB: UIButton(type: .system)
...
buttonA.backgroundColor = UIColor.green
buttonB.backgroundColor = UIColor.red
当按钮处于焦点时,我对结果感到满意,但当按钮未处于焦点时,我会得到一个丑陋的结果。绿色按钮的彩色图层缺少其角半径。
如何正确地为按钮着色?
【问题讨论】: