简体   繁体   English

故事板:具有选项卡式视图层次结构的统一导航栏

[英]Storyboard: unified navigation bar with tabbed view hierarchy

I have this view hierarchy: 我有这个视图层次结构:

UINavigationColtroller
-> UITableViewController
   -> (push) UITabBarController
      -> (tab) UITableViewController [list view]
         -> (push) UIViewController [detail view]
      -> (tab) UITableViewController
         -> (push) UIViewController
      -> (tab) UITableViewController
         -> (push) UIViewController

The problem is that navigation bar customisations won't work for bottom 3 view controllers. 问题在于导航栏自定义功能不适用于底部3个视图控制器。 It kind of makes sense, because there is a stack of navigation items 3 tab views are on the same level. 它种的是有道理的,因为有导航项目3个标签视图是在同一水平上一个堆栈

So I'm left with this alternative: 因此,我可以选择以下方法:

UINavigationColtroller
-> UITableViewController (1)
   -> (modal) UITabBarController
      -> (tab) UINavigationColtroller (2)
         -> (root) UITableViewController
            -> (push) UIViewController
      -> (tab) UINavigationColtroller (3)
         -> (root) UITableViewController
            -> (push) UIViewController
      -> (tab) UINavigationColtroller (4)
         -> (root) UITableViewController
            -> (push) UIViewController

This is terrible, because there are now four separate navigation stacks. 这很糟糕,因为现在有四个单独的导航堆栈。 Not only storyboard gets hideous, I also have add extra boilerplate in #2 , #3 , #4 wiring the left button to go back to #1 manually? 不仅情节提要板变得令人毛骨悚然,而且我还在#2#3#4添加了额外的样板,将左按钮手动连接回#1

Is there a way to maintain the navigation with just one top-level navigation stack even if there is a tab bar in-between? 即使中间有一个标签栏,有没有办法仅使用一个顶级导航堆栈来维护导航?

I think you can you ahead with 我想你可以继续前进

UITabBarController (Replace with UINavigationColtroller)
-> UINavigationColtroller (RW UITableViewController)
   -> (With hidden Tabbar) UITableViewController  (RW UITabBarController)
        ->  (push and show Tabbar) UITableViewController [list view]
        ->  (push and show Tabbar) UIViewController [detail view]
        ->  (push and show Tabbar) UITableViewController
        ->  (push and show Tabbar) UIViewController
        ->  (push and show Tabbar) UITableViewController
        ->  (push and show Tabbar) UIViewController

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

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