3
votes

By default, the UINavigationBar (and this appears to be valid to UITabBar as well) has a blur effect and is tinted white (with some translucency).

What I would like to have is a fully transparent (not translucent!) bar, and keep the blurriness of what's behind it. Here's a mockup:

If I try to set a custom bar tint color like this:
[[UINavigationBar appearance] setBarTintColor:someColorWithAlphaLessThanOne];
The bar will, however, be tinted with a color exactly the same RGB values, but alpha forced to 1. In other words, the bar will be opaque.

If I set the navigation bar's background image to a new UIImage, then it will be fully transparent, but will not have the blur effect.

How can I remove the white tint and keep the blur?

1
Let's say it is not a navigation bar. Do you know how to make a blur like the one you want?matt
On iOS 8, yes, I do. Using UIVisualEffect. On iOS 7 I'd probably need some thing like FXBlurView, but I am not sure I can achieve the full transparency effect with either of themGuilherme
Okay, so the UIVisualEffect blur is acceptable. That's what I wanted to know. So why not use a fully transparent UINavigation bar, with a UIVisualEffect blur view behind it?matt
Not quite what I expected: cl.ly/image/0Z2l340C2k1e/…Guilherme
Well, that is why I asked you if the UIVisualEffect blur was acceptable. You see, I do not know how you expect to obtain the very gentle blur you have drawn. You need to start by saying how to obtain it - in general, completely outside of the UINavigationBar world.matt

1 Answers

0
votes

I'd try to use a custom UIView for the navigation bar, and hide the actual navigation bar. You can then blur either by screenshotting, or using UIVisualEffect, or LFGlassView (if you want to support iOS 7 as well)