How set background color of a button - xcode
Just scroll a little bit in Attribute Inspector
, you can find Background
property in view
section that will allow you set the backgroundColor
for the UIButton
.
If you want to set backgroundColor
of button programatically.
Objective C :
self.yourButton.backgroundColor = [UIColor redColor];
Swift 3 and Swift 4
self.yourButton.backgroundColor = UIColor.red
Swift 2.3 or lower
self.yourButton.backgroundColor = UIColor.redColor()