How to prevent UINavigationBar from covering top of view in iOS 7? How to prevent UINavigationBar from covering top of view in iOS 7? ios ios

How to prevent UINavigationBar from covering top of view in iOS 7?


Set the navigation bar's translucent property to NO:

self.navigationController.navigationBar.translucent = NO;

This will fix the view from being framed underneath the navigation bar and status bar.

If you have to show and hide the navigation bar, then use

 if ([self respondsToSelector:@selector(edgesForExtendedLayout)])    self.edgesForExtendedLayout = UIRectEdgeNone;   // iOS 7 specific

in your viewDidLoad method.


In iOS 7 by defaults all Controller translucent property value is YES, so you set translucent property NO for this issue.

self.navController.navigationBar.translucent = NO;


You can disable the "Extend edges" in Attribute inspector of View Controller of this screen (as shown in below image):

enter image description here