Storyboard app run on iOS 7 OK but Navbar shift view on iOS 6.1
Asked Answered
C

5

11

While rebuilding my project with the new Xcode 5 released yesterday, I was disappointed to see my storyboard view controller shaken up.

After many attempts to fix things, I must conclude I'm stuck with one remaining issue: Navigation View Controller makes the navigation bar overlaps with the content of the view. Doing so, the app is ok on a iOS 7 device (no overlapping), but with a iOS 6.1 device, the navbar overlaps.

I ran a sample project from FlatUI to crosscheck the issue, and they have the same issue. Any idea please?

Callan answered 11/9, 2013 at 19:19 Comment(3)
Actually the answer is the Extends Edges flags in IB: simply uncheck the Under Top Bar flag, and you're done.Merely
Stephane de Luca: I am facing the same issue, which flag you are referring?Stymie
He means in the Attribute Inspector for the view controller, Extend Edges. There's options for Under Top Bars, Under Bottom Bars, Under Opaque Bars.Claudette
C
1

As I said in the comment: in IB (interface builder), you need to go to the "Attribute Inspector" for the view controller, and look at the "Extend Edges" attribute: simply uncheck the "Under Top Bar" flag and you're done.

Callan answered 6/6, 2014 at 19:50 Comment(0)
O
13

You are facing problem because of co-ordinate system, co-ordinate system of iOS 6 & iOS 7 are different iOS 7 Uses by default translucent properties.

Try putting this Code in viewDidLoad

if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
{
     self.edgesForExtendedLayout=NO;
}
Oden answered 13/9, 2013 at 14:9 Comment(0)
C
3

I think this is because of co-ordinate system of iOS 6 & iOS 7

Kindly check following two images.

iOS 6:

enter image description here

iOS 7 :

enter image description here

Circumgyration answered 13/9, 2013 at 12:35 Comment(4)
How to solve this problem ? i am also facing same problem, my view gets shifted upwards in iOS 7Oden
To solve this problem you manually have to check programmatically if(iOS7) { view.frame = CGRectmake(view.frame.origin.x,view.frame.origin.y,view.frame.size.width,view.frame.size.height + status bar height + anyBaryou have added height); anyBar will replace with following Navigation bar = 44 pts Tab bar = 49 You should add this values in your frame whatever you are using if both then add both the values }Circumgyration
I have made design in the .xib how should i change frame ?Oden
Probably I guess there is no way of doing this using xib.Circumgyration
C
1

As I said in the comment: in IB (interface builder), you need to go to the "Attribute Inspector" for the view controller, and look at the "Extend Edges" attribute: simply uncheck the "Under Top Bar" flag and you're done.

Callan answered 6/6, 2014 at 19:50 Comment(0)
V
0

In interface builder, in the size inspector tab, there is a section called iOS 6/7 Delta where you can fix navigation bar issue or when some control have different size in ios7 than in ios6.

Vanbuskirk answered 3/10, 2013 at 14:30 Comment(0)
T
0

You have to do two things :-

a. select that particular xib or view in storyboard and see on right pane there is extended edges option unlcik first option. now this would shift your view down perfectly.

b.all the contents inside this view will also get shifted below for that you have to set delta factor -(x pixels) for ios7 and +(pixels) for ios6. For setting 6 and 7 you have to select "view as" option in right pane of xib.

Happy coding

Tyrrell answered 6/6, 2014 at 5:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.