ViewController的标题意外消失

问题描述

我的ViewController标题出现问题。结构如下:UINavigationController > UITabBarController > UIViewController/UITableViewController

这是越野车行为的屏幕录像:https://www.dropbox.com/s/gzjcbwbcqw3y9xl/Screen%20Recording%202020-09-17%20at%2021.53.13.mov?dl=0

这些是我在情节提要中设置的选项:

enter image description here

enter image description here

有什么我想念的吗?

解决方法

从您的视频中看,您似乎有两个主屏幕,用户可以通过选项卡栏来回导航。

现在,在UITabBarController内,而不是仅添加UIViewController,而是添加一个UINavigationController,其根VC要显示任何一个UIViewController。 >

您的UITabBarController的结构如下所示: structure diagram

这样,您可以将绿色和橙色视图控制器的标题设置为所需的名称。我希望这会有所帮助,让我知道是否出现任何问题。