简体   繁体   中英

Why I can't see my navigation bar?

I have read similar threads about this issue in StackOverflow but none of them solved my problem. Usually, I have no issue setting up the Navigation Controller. As you can see in the picture below, I have set my View Controller embedded in the Navigation Controller:

(Authentication Storyboard) 在此输入图像描述

But when I run the project, I can't see my Navigation Bar, like in the picture below:

在此输入图像描述

I am presenting my VC using show segue:

在此输入图像描述

I don't know if this gives effect or not but the first picture above is actually my Authentication Storyboard. I try to separate the authentication process in the "Authentication Storyboard". The main storyboard will be like this:

在此输入图像描述

I have also set the navigation bar visibility to enable. What went wrong in here?

在此输入图像描述

The issue here seems to be the setup of your storyboard connections between your Tab Bar, Navigation and View Controllers.

This can be done in many different ways, but a fast way to do it is selecting your Main AuthVC and clicking on the menu: Editor -> Embed in -> Tab Bar Controller ). Then, repeat the process but embedding it to a Navigation Controller ( Editor -> Embed in -> Navigation Controller . And lastly, set the Tab Bar Controller as the Initial View Controller.

It should look something like this: 在此输入图像描述

This would solve the problem with the Navigation Bar:

在此输入图像描述

After Tab bar Controller add Navigation view controller.Then add your view controller. 在此输入图像描述

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