RileyE
RileyE

Reputation: 11074

iOS 7 Status Bar not over top of views without editing every view

I've seen the answers on each of these questions:

Status bar appear over my view's bounds in iOS 7

Status bar and navigation bar appear over my view's bounds in iOS 7

New iOS 7 statusBar leaves a range 20px in apps compiled in Xcode 5

iOS 7 status bar back to iOS 6 default style in iPhone app?

However, none of those answers seem to work for me. I am trying to show the status bar in the "Black Opaque" style, as I have set in the .plist.

Is there any way to have the application continue to work as if the status bar wasn't included in the window?

I've tried this:

CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0.0f, statusBarHeight, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - statusBarHeight)];

However, statusBarHeight is 0 in application:didFinishLaunchingWithOptions:. And manually setting it to 20.0f seemed to just screw up the UIWindow and the UIViewControllers would be taller than the screen. (Also, manually setting the value 20.0f feels dirty)

What am I missing?

EDIT

I should also point out that I am using a UINavigationController that hides it's UINaviationBar.

EDIT 2:

This only seems to be an issue for the application while debugging or in Ad Hoc (Test Flight) release. The exact same application on the App Store shows the status bar as it should. Why is this affecting debug and ad-hoc releases?

Upvotes: 0

Views: 1631

Answers (1)

Larry OBrien
Larry OBrien

Reputation: 8606

Set UIViewController.edgesForExtendedLayout to UIRectEdge.None

Edges For Extended Layout

Upvotes: 1

Related Questions