How to add more tabs in tab view controller storyboard application? [duplicate]

旧时模样 提交于 2019-12-20 09:48:54

问题


Possible Duplicate:
Xcode 4.2 Tabbed Application - Adding New Tab view

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. :)

Now, I want to add couple of more tabs to the main view(default, its 2 tabs; I want 3 or 4).

How Can I do it?


回答1:


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.

To Add Controller Files

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.




回答2:


Just add one more View controller on the screen drag it from the controls, then hold the right click on tab bar controller bring that click on the newly added view controller and left the click the four options will be appear there choose the topmost option by clicking on it its name is "Relationships-view controllers" . and its done.



来源:https://stackoverflow.com/questions/13820407/how-to-add-more-tabs-in-tab-view-controller-storyboard-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!