DCMaxxx
DCMaxxx

Reputation: 2574

iOS 7 Status bar transparency

I'm stuck on something that looks trivial, but I really don't understand what's happening.

I'm compiling with iOS 7 SDK, and can't get the status bar to be transparent. It's fully black. In my .plist, Status bar style is Transparent black style (alpha of 0.5). I've tried all the other options, but I couldn't get it to work.

I still need to support iOS 6, but I'd expect iOS 7 status bar to be transparent by default, right ?

Any idea on what could cause this ?

Thanks

Upvotes: 9

Views: 26814

Answers (3)

DCMaxxx
DCMaxxx

Reputation: 2574

I'll answer to my own question, sorry about the waste of time.

My mistake was, the status bar was transparent. But for whatever reason, calling

[self.navigationController setNavigationBarHidden:YES animated:YES];

changed the top inset of my scrollview from 0.f to 20.f... So, I had a black background under my status bar, and therefore, a black status bar.

Thanks anyway !

Upvotes: 7

hope this helps

self.navigationController.navigationBar.translucent = YES;

Upvotes: -4

Michael Silunsky
Michael Silunsky

Reputation: 120

Add this code to your .m file:

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

Upvotes: 5

Related Questions