简体   繁体   中英

How to preserve TabBar interface when the previous view was from a Navigation Controller

Here the basic navigation scheme in my application

http://i.stack.imgur.com/xaDtw.jpg

Once I access the first view of the Tabbed View Controller, the TabView button interface is not present, rather only the top navbar with a "back" button. I want the View governed by both controllers. I've seen a lot of posts around here about this but they're all severely outdated and any pages linked to are no longer available.

You need to change this:

      NavController-->tabBarController
                               |
                               |
                               |->Item1ViewController
                               |
                               |->Item2ViewController
                               |
                               |->Item3ViewController

To this:

                      tabBarController
                               |
                               |
                               |-->NavController->Item1ViewController
                               |
                               |-->NavController->Item2ViewController
                               |
                               |-->NavController->Item3ViewController

How you manage this part:

-->NavController-->ViewController-->TabBarController

Depends on what you are aiming to do... is that viewController a loginScreen for example? You have various options such as

-->NavController-->ViewController--[modal segue]-->TabBarController

-->TabBarController-->Item1ViewController--[modal segue]-->loginController

That's a broader app design issue...

I have related answers here: My Tab bar controller disappears after a push segue

and here: How to handle UINavigationControllers and UITabBarControllers iOS 6.1

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