8

For some reason the blur effect is gone from my app on iOS 7.1. I'm running the same code on a device with iOS 7.0.x and on another with 7.1. Here's what I see:

iOS 7.0.x iOS 7.0.x

iOS 7.1 iOS 7.1

What can be the issue and how to fix this? (obviously I want to keep the blur effect :))

UPDATE:

This is the color I set:

    [UIColor colorWithRed:255.0f/255.0f
                       green:201.0f/255.0f
                        blue:0.0f/255.0f
                       alpha:1.0];

and I set it from the barTintColor property

Sergey Katranuk
  • 1,162
  • 1
  • 13
  • 23
  • possible duplicate of [How to consolidating the translucency of the navigation bar between iPhone 5S and 5?](http://stackoverflow.com/questions/20436450/how-to-consolidating-the-translucency-of-the-navigation-bar-between-iphone-5s-an) – jervine10 Mar 27 '14 at 13:32
  • Maybe you could show this *same code* you run ? – Tancrede Chazallet Mar 27 '14 at 13:34
  • @AncAinu edited post with code used – Sergey Katranuk Mar 27 '14 at 13:49
  • @jervine10 well that post doesn't really have an answer. It has a cause. My question is how do I get the blur effect back on 7.1 – Sergey Katranuk Mar 27 '14 at 13:51
  • @SergeyCatraniuc did you try my solution ? – Tancrede Chazallet Mar 27 '14 at 16:31
  • the blurring effect appears on `armv7s` or `arm64` (or newest I'd guess) architectures only in iOS7.1+. on the rest of the architectures it is just a semi-transparent view. – holex Mar 27 '14 at 16:49
  • @holex yes, I'm well aware of that. As written in a previous comment I'm using a 5c and 5s phones, which should support the blurring – Sergey Katranuk Mar 27 '14 at 17:35
  • From my tests, the only way to have some sort of translucent navigation bar with the native SDK (i.e. w/o FXBlurView and the like), is to use UIBarStyleBlack with translucent = YES -> all other settings simply result in barely visible blurring effect. Still waiting for someone (or Apple) to solve this issue. – Or Sharir Mar 30 '14 at 13:59
  • Just wanted to add that with my proposed configuration, you can have a faint tint using backgroundColor with alpha<1. For apps that already use a dark theme, it might be good enough. – Or Sharir Mar 30 '14 at 14:13

4 Answers4

2

Probably the second screenshot is taken from an iPhone 4 ? On the iPhone 4 and iPad 2 blur effect is replaced with a simply sample color with transparency.

Fry
  • 6,235
  • 8
  • 54
  • 93
2

By the way, it's worth noting that the image that you describe as having no blurring/translucency actually does. If you take that snapshot and pump up the contrast, you can see that there actually is something going on in the background. Here is your original "no blurring/translucency image", which I bumped up contrast in Photoshop:

high contrast

It's barely visible to the naked eye unless you manipulate the image, but the blurring/translucency is actually there.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • 1
    I agree. I think they just scaled back the translucency-blurring a little. Rightly so in my opinion. :) – matt Mar 28 '14 at 04:34
  • yeah, I've noticed that it's not completely solid. I've also tried your solution and it doesn't work on my 5s with 7.1 installed. Actually changing the alpha doesn't make any difference at all :( – Sergey Katranuk Mar 28 '14 at 11:05
  • what device and iOS version did you use to take those screenshots? – Sergey Katranuk Mar 28 '14 at 11:05
  • 1
    My bad. On 7.1 device, the `alpha` setting has no effect. I've removed that from my answer. – Rob Mar 28 '14 at 12:23
1

Settings > General > Increase Contrast > Reduce Transparency is probably enabled on the 7.1 device.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
0

At a glance

It seems the navigation bar simply doesn't have anymore blur effet since iOS7.1. At least I ran many tests, by doing new app sample, it doesn't have anymore.

Workaround (work on iOS 7.1)

Here a sample using FXBlurView

It's not marvelous but it works fine and it's customizable. My example is certainly not the best.

Previous solution proposed (doesn't work on iOS7.1)

Here is my solution to find back a similar effect. It is ok for release it doesn't use private API. But it can have issue with next update of iOS since it rely on inside structure of UINavigationBar.

Simply do that in your viewDidLoad or where ever you want since it works :

// First we make the background's navigation bar totally translucent
self.navigationController.navigationBar.barTintColor = [UIColor clearColor];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];

// Then we create UIToolBar, which are still using blur effect
UIToolbar *tab = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];
// We add it the barTintColor we want, works the same as since iOS 7.0.3, don't forget alpha value
tab.barTintColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.2];

// And finally we add it to the background view of UINavigationBar... but it can change with future release of iOS. Be aware !
[[self.navigationController.navigationBar.subviews firstObject] addSubview:tab];

I also advice you to use AutoLayout to constraint the UIToolBar to be always the size of it's parent, for rotations etc... I didn't do it to let the code short and simple.

Hope it helps you guys !

Tancrede Chazallet
  • 7,035
  • 6
  • 41
  • 62