Marco Manzoni
Marco Manzoni

Reputation: 707

iOS 7 UINavigationBar with iOS 6 style

I was developing an App for iOS 6 and this is one of my views.enter image description here

Now I've updated my iPhone to iOS 7 and this is the result:

enter image description here

Now all the views are behind the navigation bar because iOS 7' UIViewController's views starts at the top left edge of the screen and not under the UINavigationBar as iOS 6. Now the "email" field is behind the navigation bar. Is there a way to use the iOS 6 style?

Thanks

Marco

Upvotes: 9

Views: 4076

Answers (3)

Niclas Gleesborg
Niclas Gleesborg

Reputation: 566

I had a similar problem and I fixed it by writing following code in the views' viewWillAppear method:

self.edgesForExtendedLayout = UIRectEdgeNone;

Upvotes: 0

OnkaPlonka
OnkaPlonka

Reputation: 1232

STEP BY STEP WITH IMAGES

Upon reading this question I was experimenting as I had the exact same question. I then found the answer.

1) Make sure storyboard is on iOS 7

enter image description here

2.) Select the viewcontroller from the storyboard (In your case the Login Controller) enter image description here

3.) Make sure that 'Under Top Bars' is Deselected

enter image description here

Upvotes: 7

BlueBear
BlueBear

Reputation: 7639

You need to turn off translucent for the navigation bar and that should adjust the iOS 7 constraints to be the bottom of the navigation bar again.

They have completely removed the old style for navigation bars in iOS 7. You could set the navigation bar to be an image, which could utilize the look from iOS 6, but I think it would be safer to just go with the new iOS 7 default appearance.

Upvotes: 3

Related Questions