Reputation: 2551
var controllerScreen = UIImageView()
controllerScreen.backgroundColor = UIColor.redColor()
This adds red opaque color to the UIImageView. I want to add a transparent red color. Is there any transparent property or something ?
Upvotes: 1
Views: 11365
Reputation: 22939
As an alternative to @AdamPro13's answer you could do:
controllerScreen.backgroundColor = UIColor.redColor().colorWithAlphaComponent(0.5)
Upvotes: 5
Reputation: 7400
You need to change the alpha value of the red color. You can use something like this: UIColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.5)
Upvotes: 4