简体   繁体   English

为什么我看不到我的导航栏?

[英]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. 我在StackOverflow中读过关于这个问题的类似线程,但没有一个解决了我的问题。 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: 如下图所示,我已将View 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: 我使用show segue呈现我的VC:

在此输入图像描述

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 ). 这可以通过许多不同的方式完成,但快速的方法是选择Main AuthVC并单击菜单: 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. 然后,重复该过程,但将其嵌入到导航控制器( Editor -> Embed in -> Navigation 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. 标签栏控制器添加导航视图控制器后。然后添加视图控制器。 在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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