【发布时间】:2018-11-04 20:45:07
【问题描述】:
我有一个用 Swift 编写的 iOS 应用程序,带有 UITabBarController 和 5 UIViewControllers。现在,我有一堆不属于UITabBarController 的UIViewControllers。我希望能够显示相同的标签栏,但我不知道该怎么做。有什么线索吗?
更多细节:这是标签栏拥有的视图控制器之一。我使用故事板引用并将我的视图控制器拆分为单独的更易于管理的故事板。
所以,大局:
没有初始 ViewController,因为我使用 storyboardId 来访问初始导航控制器。从那里我们在同一个导航控制器中嵌入了一个 ViewController。 In that ViewController, there are 2 Container views - one of the size of the bottom ViewController that contains the "hamburger" button that toggles the other Container View which has an embedded UITableView in. When a specific cell is selected it should go to Profile ViewController这甚至不在同一个故事板中。 segue 设置为 Push。无论哪种方式,都不会在 Profile ViewController 上显示 UITabBar
【问题讨论】:
-
你如何展示/展示其他
UIViewControllers?如果它们被推送到属于UITabBarController层次结构的UINavigationController,那么标签栏应该是可见的。 -
嗯,这取决于但我将整个项目分成许多故事板并通过故事板参考连接。所以,segue 可以是我想的任何东西
-
好吧,正如我所说,例如,如果您的一个
UITabBarController有一个UINavigationController作为它的项目之一,每当您在它的堆栈上推送一个新的UIViewController时,标签栏就会保持原位.如果您以模态方式呈现它,标签栏将被隐藏。 -
@MihaiFratu 我认为我做错了什么,因为它不起作用。我在帖子本身中添加了更多细节和一些屏幕截图。你能看一下吗?
标签: swift xcode uiviewcontroller uitabbarcontroller