Search code examples
iosuinavigationcontrollerios7statusbarpresentmodalviewcontroller

Presented view controller covers status bar in iOS 7


I have a presented view controller in iOS 7 that doesn't have a navigation bar, but the status bar is visible. I tried setting the edgesForExtendedLayout to UIRectEdgeNone, but that doesn't seem to do anything (unless I show a navigation bar, which I don't need).

Doesn't seem to be a topLayoutGuide in interface builder (view uses a nib, not a storyboard) and was having trouble with that anyway.

Could hide status bar like this:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

But I don't really want to hide it. Note there are some similar questions, but they discuss using a navigation bar. This one, I don't want the navigation bar.

Screenshot: https://i.sstatic.net/6OW9F.png

EDIT: Switched to using a storyboard and was able to get the top layout guide working properly


Solution

  • Switched to using a storyboard and was able to get the top layout guide working properly