iOS Change color of label affected by UIVibrancyEffect

1.5k Views Asked by At

Is there a way to somehow affect the color of a label which is under vibrancy effect or at least bring some contrast by setting some tint/alpha/background/whatever properties? As you can see below, in my case the vibrancy created almost unreadable text...

enter image description here

3

There are 3 best solutions below

0
frangulyan On BEST ANSWER

When I went through 2014 WWDC video I found at least some way to affect the appearance of the vibrancy. You can set the background color of the original blur view's contentView like this:

blurView.contentView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.01];

which will unfortunately also affect the whole blur (by tinting) on which the vibrancy was based. But at least the text is much more readable after that.

1
Tapansinh Solanki On

Yes u can. To render vibrant text, create a UILabel and add it to the vibrancy UIVisualEffectView's contentView. The color of the UILabel does not affect its appearance.

Go through the following link for demo project. https://github.com/ide/UIVisualEffects

0
Maayan Zalevas On

I don't think that what you're asking for is doable, but I had a similar problem and this link helped me improve my design.