2012-08-17 67 views
0

目前我正在簡單的iphone應用程序,使用tabbar設置五個按鈕,然後我選擇第三個選項卡時tabbar是隱藏的,然後我顯示在tabbar區域的工具欄功能,但工具欄沒有顯示,是否有可能顯示工具欄時Tabbar是否隱藏時間?請幫我如何隱藏tabbar時顯示工具欄?

由於提前

我嘗試這樣做:

[self.tabbarController.tabbar setHidden:YES]; 
+0

看到這個帖子http://stackoverflow.com/questions/1982172/iphone-is-it-possible-to-hide-the-tabbar – rakeshNS 2012-08-17 16:44:37

+0

感謝seperatly創建一個工具欄rakesh爲你的幫助 – SampathKumar 2012-08-17 16:52:34

+0

嗨,親愛的,試試這一個http://stackoverflow.com/questions/3544701/show-tab-bar-after-its-hidden by @imaginaryboy – rakeshNS 2012-08-17 17:00:28

回答

0

是的,只要設置工具欄的隱藏屬性爲NO [self.tabBarController.tabBar setHidden:YES]後;

+0

感謝您的回覆,現在我檢查它並更新您。 – SampathKumar 2012-08-17 16:43:03

+0

嗨拉維,對不起,說這個我試過你的場景,但它沒有幫助 – SampathKumar 2012-08-17 16:47:18

0

您不能禁用某些頁面的tabbar,但不能禁用其他頁面的tabbar。你可以做的是在tabbar上畫一個工具欄。

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 
UIToolbar * tb = [[UIToolbar alloc] init]; 
tb.frame = CGRectMake(0, delegate.window.frame.size.height-44, 320, 44); 
[delegate.window addSubview:tb]; 
+0

感謝您的回覆 – SampathKumar 2012-08-17 16:49:08

+0

對不起說這個,我試過了你的場景,但它沒有幫助 – SampathKumar 2012-08-17 16:51:52

+0

有沒有顯示一個工具欄?因爲我在我的應用程序中嘗試過它,它工作正常。一定要將第一行的AppDelegate替換爲應用程序委託的實際名稱。 – nonmll 2012-08-17 16:54:09

0

首先,您需要在appdelegate.m文件中創建一個標籤欄,然後只有您可以隱藏工具欄。 或者您也可以通過這個代碼

UIToolbar *toolbar = [[UIToolbar alloc] init]; 
toolbar.frame = CGRectMake(0, 418, 320, 44); 

[self.view addSubview:toolbar]; 
[toolbar release];