Transparent UINavigationBar but with blur
By default, UINavigationBar
(and this seems to be the case for UITabBar
), it has a blur effect and is painted white (with some transparency).
What I would like to have is a completely transparent (not transparent!) Bar and keep the blur of what is behind it. Here's the layout:
If I try to set the tint color of a custom color like this:
[[UINavigationBar appearance] setBarTintColor:someColorWithAlphaLessThanOne];
However, the bar will be colored with exactly the same RGB values, but the alpha is forced to 1. In other words, the bar will be opaque.
If I set the background image of the navbar to a new one UIImage
, then it will be completely transparent but will not have a blur effect.
How do I remove the white cast and keep the blur?
source to share
I would try to use a custom one UIView
for the navbar and hide the actual navbar. Then you can blur either with screenshots or with UIVisualEffect
, or LFGlassView
(if you want to support iOS 7 as well)
source to share