PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 29, 2022

[FIXED] How to set color of UIButton type: .system for tvOS in Swift

 September 29, 2022     swift, tvos, uibutton     No comments   

Issue

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.

enter image description here

How do I color the buttons correctly?


Solution

buttonA.layer.cornerRadius = 10



Answered By - iSebbeYT
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing