2010-04-04 91 views
1

所以,我想我的应用程序以一个UIViewController开始(没有看到一个tabbar),然后用导航栏和tabbar输入一个UITableView。问题是Tabbar是在应用程序启动时可见的,任何人都可以在此帮助将非常赞赏...如何在应用程序启动时隐藏一个tabbar?

回答

0

我认为你应该发送-presentModalViewController:动画:使用标签栏控制器的主UIViewController作为一个参数或只是这样做:

[myWindow addSubview: myTabBarController.view]; 
0

让您的应用导航应用基础(而不是基于一个标签栏),然后在UITableView的添加标签栏。

有添加的UITabBar here

我做这样的帮助:在这种情况下,绘制表格视图和地图视图(从Locati应用程序)

tabBarController = [[UITabBarController alloc] init];   // creates your tab bar so you can add everything else to it 

searchTableViewController = [[SearchTableViewController alloc] init];    // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController 
UINavigationController *searchTableNavController = [[[UINavigationController alloc] initWithRootViewController:searchTableViewController] autorelease]; 
[searchTableViewController release];                // creates your table view's navigation controller, then adds the view controller you made. Note I then let go of the view controller as the navigation controller now holds onto it 

searchMapViewController = [[SearchMapViewController alloc] init]; 
UINavigationController *mapTableNavController = [[[UINavigationController alloc] initWithRootViewController:searchMapViewController] autorelease]; 
[searchMapViewController release];             // does exactly the same as the first round, but for your second tab at the bottom of the bar. 

tabBarController.viewControllers = [NSArray arrayWithObjects:searchTableNavController, mapTableNavController, nil]; //add both of your navigation controllers to the tab bar. You can put as many controllers on as you like 

我发现这很久很久以前。对不起,我不能指出原文。 然后你需要添加tabbarcontoller到相关的视图([...查看addSubView:tabBarController];)可能首先设置框架。

+0

是的,我的应用程序是一个基于导航的应用程序,主窗口调用带tabbar和导航栏的UITableView,我认为这就是为什么tabbar显示在启动视图(它是UIViewController)的原因。它将不胜感激,如果你可以张贴一些示例代码.. – Georg 2010-04-04 10:39:28

+0

我的应用程序是一个基于TabBar的应用程序,这是加载一个UIView没有tabbar控制器可见? – Georg 2010-04-05 14:43:54

+0

是的。制作基于视图的应用程序。将标签栏添加到您想要标签栏的屏幕上。 – Andiih 2010-04-06 13:17:20

相关问题