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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With