Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 status bar transparent

In storyboard, in a view controller I tried add a navigation bar under the status bar, running it, it is transparent and shows a label that's supposed to be blurred, like by navigation bar.

enter image description here

But when placing the same view controller embedded in a navigation view controller, the underneath background image could be blurred, which is my intention.

enter image description here

What are these two way different results? What need to do for the firs method to make status bar blur?

Thanks!

like image 733
S1U Avatar asked Aug 13 '13 02:08

S1U


3 Answers

In iOS 7 the status bar is transparent by default. The blurring you're seeing when there's also a navigation bar is actually created by the navigation bar. So to create the effect you're looking for without a navigation bar, you need to position a view that produces a blurring effect beneath the status bar.

For reference, add your view with a frame provided by:

CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
like image 103
Matt Hall Avatar answered Nov 15 '22 22:11

Matt Hall


I know this is old, just for reference, I solved this by setting self.navigationController.navigationBar.clipToBounds = NO

like image 38
AuA Avatar answered Nov 15 '22 23:11

AuA


I haven't tested this completely, but go to your plist file and check the following settings:

"View controller-based status bar appearance": If this is set to "Yes", then it should display a status bar that is unique to each View Controller, which might be what you need.

"Status bar style": You may set this to three different styles: Opaque black, Gray, and Transparent black.

Let me know if this worked for you.

like image 35
w3bshark Avatar answered Nov 15 '22 21:11

w3bshark