helloB
helloB

Reputation: 3582

iOS Strong white text on faded white background?

I have a subview with a white background and low alpha value (.2) and this subview includes several UILabel elements that have their text set to white and their alpha values set to 1. I cannot see the text. If I change the text color it works fine, and I can see the text at full alpha as desired. I have tried changing the subview's background to gray, but I continue not to be able to see the white text. How can I achieve the effect of strong white text on a faded white background?

Upvotes: 0

Views: 92

Answers (1)

Sami Kuhmonen
Sami Kuhmonen

Reputation: 31203

If you set the alpha value of a control, all sub controls are also drawn with that value. What you want is to change the background color to have low alpha, so it will be translucent, but everything inside the control will still have total opacity.

Also the control has to be on top of something else than white background, otherwise it will just be white.

Upvotes: 1

Related Questions