带导航控制器的标签栏应用程序 [英] Tab Bar Application With Navigation Controller

查看:140
本文介绍了带导航控制器的标签栏应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的iPhone应用程序,它有一个标签栏和3个标签。每个选项卡作为单独的笔尖加载相应的控制器。每个笔尖都包含一个tableview和一些其他控件用于搜索/过滤等。

I have a simple iPhone app that has a tab bar and 3 tabs. Each tab loads as a separate nib with a corresponding controller. Each nib contains a tableview with some other controls for searching/filtering etc.

我想要的(并且似乎无法找到一个例子)是添加导航控制器应用程序,以便每个笔尖(即每个标签)可以向下钻取更多细节页面。

What I would like (and cant seem to find an example of) is adding a navigation controller to the app so each nib (i.e. each tab) can drill down to further detail pages.

我是否应该在主窗口中添加导航控制器并创建 IBOutlet 为它或NC应该添加到笔尖。

Should I be adding a navigation controller to the main window and creating an IBOutlet for it or should the NC be added to the nibs.

推荐答案

一旦你在XIB中有一个标签栏,最简单的方法是将UINavigationController对象从Library窗口(看起来像金色背景上的左侧导航栏按钮)拖动到标签栏的树视图中(仅限文本)查看,而不是GUI)。将导航控制器放在标签栏控制器内,然后将现有的视图控制器拖动到导航控制器内。

Once you have a tab bar in a XIB, the easiest way to approach this is to drag a UINavigationController object over from the Library window (looks like a left nav bar button on a gold background) into the Tree View for your tab bar (the text only view, not the GUI). Place the navigation controller inside the tab bar controller, then drag your existing view controller inside the navigation controller.

当您去查看该选项卡时,您应该会看到一个导航栏在它的顶部......如果你从另一个xib加载导航控制器,你将修改标签栏xib中的导航栏。

When you go to view that tab you should then see a navigation bar on the top of it... if you are loading the navigation controller from another xib, you'll modify the nav bar in the tab bar xib.

这篇关于带导航控制器的标签栏应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆