UITabBar+UITableviewController in navigation based applications

后端 未结 2 1327
自闭症患者
自闭症患者 2021-01-24 06:17

I am trying to put a UITabBar on a Rootviewcontroller.xib to a Navigation based Application. I know that we used navigation based applicaitons for Tableviews and by default thos

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-24 06:35

    If I am reading your correctly, I think that you're thinking of it in the wrong way.

    From what I'm reading you're trying to have:

    UINavigationController -> "Tab Bar Controller (as the root to the stack)" -> UITableViewController (as the Tab Bar Controller's selected view)

    Then, whenever a user selects a cell in the table you push a new view view into the UINavigationController while keeping the tab bar shown.

    If this is right, then the solution is to rework your view controllers.

    What you want is a UITabBarController -> UINavigationController (as the view for the selected UITabBarItem) which holds a UITableViewController (or UIViewController with a UITableView) for your main view.

    This way whenever you select an item within the table, you push it into the parent UINavigationController stack, and the UITabBar at the bottom will remain.

    If you need an example, I'd be glad to try and help, too.

提交回复
热议问题