将选项卡栏视图添加到现有的基于表的应用程序中-iPhone [英] Adding Tab Bar View into an Existing Table Based App - iPhone

查看:49
本文介绍了将选项卡栏视图添加到现有的基于表的应用程序中-iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于表的应用程序,想在底部添加一个标签栏,以便在此表和其他视图之间切换.

I have a table based app and would like to add a tab bar to the bottom to switch between this table and other views.

msot轻松实现此目的的方法是什么?我可以在表格视图下插入标签视图控制器吗?

What is the msot hassle free way to do this ? Can I just wire in a tab view controller underneath the table view?

谢谢

马丁

推荐答案

实际上,您必须将视图控制器加载到UITabBarController中.因此,如果您有tableViewController,viewController1和viewController 2,则要将所有这些添加到tabBarController.

You actually have to load your view controllers into a UITabBarController. So if you have a tableViewController, viewController1, and viewController 2, you want to add all those to the tabBarController.

UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers:[NSArray arrayWithObjects:tableViewController, vc1, vc2];

[self.window addSubView:tabBarController.view];
[self.window makeKeyAndVisible];

这篇关于将选项卡栏视图添加到现有的基于表的应用程序中-iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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