iPad上的表格视图封面标签栏

时间:2011-09-19 17:28:03

标签: ios ipad uitabbarcontroller

我正在用UITabBarController编写一个iPad应用程序。目前它有两个按钮。当用户按下第一个按钮时,我会调出一个表格视图。当用户选择一行时,我切换到另一个表视图。麻烦的是,当第二个表格视图出现时,标签栏不再可见。我觉得我需要添加第二个表视图作为第一个的子视图,以防止覆盖标签栏。救命啊!

1 个答案:

答案 0 :(得分:1)

当我准备睡觉时,我会做出一些假设,发布一个我希望可以帮助你的解决方案:)

首先,我相信你有一个

UINavigationController
-> UITabBarController
   -> UITableViewController 

栈。

现在,如果你将新视图推送到堆栈上会发生什么,它将使用存在于堆栈顶部的UINavigationController。所以你现在得到的是

UINavigationController
-> UITableViewController2
-> UITabBarController
   -> UITableViewController
正如你所说,

隐藏了你的TabBar。您不能使用模态视图,因为它将位于所有内容之上,并阻止所有其他视图进行交互。

所以,你真正需要的是UITabBarController中的另一个UINavigationController,就像这样

UINavigationController
-> UITabBarController
   -> UINavigationController 
      -> UITableViewController

所以当你按下第二个视图时,你会得到这个

UINavigationController
-> UITabBarController
   -> UINavigationController
      -> UITableViewController2
      -> UITableViewController

希望这可以帮助你。