简体   繁体   中英

iOS Navigation Bar in tab bar controller doesn't rotate properly

I have a tab bar controller whose 2 tabs both contain views with navigation bar controllers. When I display the app in portrait everything is fine, however when I display just the first tab in portrait, then rotate the device and display the second tab in landscape, the navigation bar of the second view stretches while the first stays in 'portrait size'. I have been able to replicate this in a basic project that I've uploaded to rapid share

I am guessing this is a easy fix.

Thanks in advance!

Found the answer. I had a view for each tab with a navigation controller within that view. By changing the tab view to a navigation controller instead, resolved this error.

Basically, my original setup was tab navigator -> view -> navigation controller

This I changed to tab navigator -> navigation controller

It works correctly now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM