2010-04-04 47 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

相關問題