将当前 TabBarController 视图设置为 UINavigationcontroller 的根视图

发布于 2024-12-28 11:37:29 字数 1323 浏览 0 评论 0原文

我一直在寻找一种实现下面层次结构的好方法。

我已经完成了其他三个视图的登录和 UITabBarController 的实现。

我现在需要的是让选定的选项卡充当我即将实现的 UINavigationcontroller 中的 rootviewcontroller ,该控制器应该处理详细视图的推送和弹出。

层次结构摘要:

LoginView--
    TabBarController - Holds it's own view and the three views below. 
             OneView (If selected should be root for UINavigationcontroller)
               - DetailView (DetailView of OneView)
                    -DetailView (Details of detailview)
             AnotherView (If selected should be root for UINavigationcontroller)
                - DetailView (DetailView of AnotherView)
                    -DetailView (Details of detailview)
             AThirdView (If selected should be root for UINavigationcontroller)
                - DetailView (DetailView of AThirdView)
                    -DetailView (Details of detailview)

三个视图,lon、schema 和 tidsaldo 都连接到界面构建器中的 UITabBarController

因此,我基本上需要帮助的是一些关于如何使这三个选项卡中的任何一个成为我的 UINavigationController 的根的指南和/或技巧。

我尝试过的事情之一是抓住App Delegate并为UINavigationController添加当前rootviewcontroller的子视图。但这让我以某种方式松开了标签栏。

任何提示和/或指示都将受到高度赞赏。

附言。可能有错别字。

层次结构

I've been searching around for a good way to implement the hierarchy below.

I've completed the implementation of the login and the UITabBarController for the other three views.

What i need now is for the selected tab to act as the rootviewcontroller in my soon to be implemented UINavigationcontroller, which is supposed to handle pushing and popping from and to the detailed views.

Hierarchy summary:

LoginView--
    TabBarController - Holds it's own view and the three views below. 
             OneView (If selected should be root for UINavigationcontroller)
               - DetailView (DetailView of OneView)
                    -DetailView (Details of detailview)
             AnotherView (If selected should be root for UINavigationcontroller)
                - DetailView (DetailView of AnotherView)
                    -DetailView (Details of detailview)
             AThirdView (If selected should be root for UINavigationcontroller)
                - DetailView (DetailView of AThirdView)
                    -DetailView (Details of detailview)

The three views, lon, schema and tidsaldo are all connected to the UITabBarController in the interface builder.

So, what i basically need help with, is some guidelines and/or tips on how to make either of those three tabs the root for my UINavigationController.

What i've tried among other things is to grab hold of the App Delegate and adding the subview of the current rootviewcontroller for the UINavigationController. But that makes me loose the tabbar somehow.

Any tips and/or pointers are highly appreciated.

PS. There might be typos.

Hierarchy structure

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

○愚か者の日 2025-01-04 11:37:29

通过在 Tabbarcontroller 中添加 Navigationcontrollers 而不是 Viewcontrollers 来解决。

Solved by adding Navigationcontrollers in the Tabbarcontroller instead of Viewcontrollers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文