I am running same app in iOS6 and iOS7 which has NavigationBar.It runs well on iOS6, but in iOS7, all view is little bit up like it is not considering the Navigation bar at all.
I have tried changing topbar property in simulated metrics option but it doesnt work. It considers button's position from NavigationBar in iOS6, but in iOS7, it considers it from top of the screen.
What is the reason for it?
Thanks in advance.
You should use below line for fix it in your view.
self.edgesForExtendedLayout = UIRectEdgeNone;
In "iOS 7 UI Transition Guide" for Layout and Appearance one also mentioned - in iOS7 in, view controllers use the full screen layout.
If we want the view shows the following location from the navigation bar, you can modify the UIViewController's edgesForExtendedLayout this property to achieve.
edgesForExtendedLayout is a type UIExtendedEdge attribute that specifies the direction of the edge to be extended.
Because iOS7 encourage full screen layout, its default value is natural to be UIRectEdgeAll, both extending around the edge, that is, if there is even the view navigationBar, under tabBar, then the view will extend coverage to the surrounding area.
If we make the following settings view, then the view will not be extended to those behind the bar, so label came out.
View Source Print
self . edgesForExtendedLayout = UIRectEdgeNone ;
In iOS 7, view controllers use full-screen layout. it is mentioned in iOS 7 UI Transition Guide
if you want change the layout use edgesForExtendedLayout property
example:
if([UIViewController instancesRespondToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout=UIRectEdgeNone;
I had a similar issue myself and found that if you turn off the translucency of the navigation bar the views will drop down the same as they did in iOS6.
self.navigationController.navigationBar.translucent = NO;
At the time of this answer, iOS 7 was still under NDA, so it was not possible to write the actual solution. To help anyway, I've posted a helping link available only for registered developers.
==== Original Post: ====
Read the iOS 7 Transition Guide. Its section 'Updating the UI' explains how to fix your problem.
if([self respondsToSelector:@selector(edgesForExtendedLayout)])
[self setEdgesForExtendedLayout:UIRectEdgeBottom];