2010-10-03 36 views
1

我有一個UIViewController,它有一個模式窗口,我想在整個界面上展示,包括UITabBar。當UIViewController顯示爲模態時隱藏UITabBar

我的應用程序的層次結構是這樣的:

UITabBarController (A) -> 
    UIViewController (B) -> 
     UINavigationController (C) -> 
      UIViewController (D) -> 
       UIViewController (my modal view) 

當我打電話presentModalViewController上d,模態視圖呈現,但UITabBar下,還是應該我說了,UITabBar仍顯示。

我試過在模態視圖控制器上設置hidesBottomBarWhenPushed屬性爲YES,但無濟於事。

任何想法,爲什麼這不適合我?

+0

我從來沒有得到過這個問題。我的所有模式都顯示在標籤欄上。我認爲這將是你的控制器層次結構。通常是UITabBarController-> UINavigationController-> UIViewController。如果你沒有足夠的理由這樣做,我認爲你必須刪除(B)。 – Jorge 2010-10-03 06:46:51

回答

3

模態ViewController需要成爲TabBarController的直接孩子才能做你想做的事。

而不是視圖控制器 「d」

,:

[self presentModalViewController:...]; 

做:

[tabBarController presentModalViewController:...]; 

你如何保持對TabBarController一提的是取決於你。

+0

工作過。 – d2kagw 2010-10-05 02:31:03