I am creating an app for tvOS. I am trying to set the color of an UIButton but does not know how to get I t right.
var buttonA: UIButton(type: .system)
var buttonB: UIButton(type: .system)
...
buttonA.backgroundColor = UIColor.green
buttonB.backgroundColor = UIColor.red
I am happy with the result when the button is in focus but when the button is not in focus I get an ugly result. The green button has a colored layer that is missing its cornerRadius.
How do I color the buttons correctly?
buttonA.layer.cornerRadius = 10