如何在选项卡视图控制器故事板应用程序中添加更多选项卡? [英] How to add more tabs in tab view controller storyboard application?

查看:38
本文介绍了如何在选项卡视图控制器故事板应用程序中添加更多选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
Xcode 4.2 选项卡式应用程序 - 添加新选项卡视图

我是 iPhone 应用程序的新手,我关注了 以下教程使用故事板开发标签视图应用程序:

I'm new to iPhone app and I followed following tutorial to develop a tab view application using story board:

一切正常.感谢作者.:)

It's working fine.Thanks to the Author. :)

现在,我想在主视图中添加更多选项卡(默认为 2 个选项卡;我想要 3 或 4 个).

我该怎么做?

推荐答案

添加一个视图控制器 (UIViewController) 并与您的 tabBarController 以关系视图控制器"添加它(要做到这一点,请右键单击标签栏控制器并拖动它到新的视图控制器并选择最底部的关系海格,即视图控制器),您的 XIB 页面应如下所示:

Add one view controller (UIViewController) And Add it with your tabBarController in relationship "View Controllers"(To do this right click on tab bar controller and drag it to new view controller and select bottom most relationship seague, i.e. view controller), your XIB page should look like:

您可以对其余部分应用相同的模式.

You can apply same pattern for the rest.

正如@Jamie 所说:您必须转到菜单并单击新建文件",然后单击 Objective-C 类,最后确保选择 UIViewController 子类.命名它,然后它将添加文件.现在在您的故事板中,确保将每个选项卡的类更改为您的文件名.即为您的 ViewController 分配自定义类,我在 Image 中使用了 Name AAA.

As @Jamie Said: You have to go to the menu and click on "New File", then Objective-C class, and finally make sure to select UIViewController subclass. Name it and then it will add the files. Now in your storyboard make sure to change the class of each tab to the name of your file. i.e. to assign custom class for your ViewController this I have used Name AAA for that in Image.

这篇关于如何在选项卡视图控制器故事板应用程序中添加更多选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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