Reputation: 433
I'm using UILabel to hold some text. What I want is to make UILabel background with alpha of 0.4 but not the text. How to achieve this ?
Upvotes: 3
Views: 3307
Reputation: 2064
yourLabel.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.4];
Obviously you can change the RGB colors to what you want.
Upvotes: 5
Reputation: 7098
Select your label in Interface Builder. In the Attributes Inspector, find "Background" under the "View" section. Click on the color rectangle next to the color name. Opacity is one of the properties you can set in the window that pops up. Set that to 40%.
Upvotes: 6