iPad 上的表格视图覆盖选项卡栏
我正在使用 UITabBarController 编写 iPad 应用程序。目前它有两个按钮。当用户按下第一个按钮时,我会弹出一个表格视图。当用户选择一行时,我切换到另一个表视图。问题是,当第二个表格视图出现时,选项卡栏不再可见。我觉得我需要将第二个表视图添加为第一个表视图的子视图,以防止覆盖选项卡栏。帮助!
I'm writing an iPad app with a UITabBarController. At the moment it has two buttons. When the user presses the first button I bring up a table view. When the use selects a row I switch to another table view. Trouble is, when the second tabel view comes up, the tab bar is no longer visible. I feel like I need to add the second table view as a subview of the first to keep from covering the tab bar. Help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我要睡觉时,我将做出一些假设,发布一个希望对您有所帮助的解决方案:)
首先,我相信您已经有了一个
堆栈。
现在,如果您将新视图推送到堆栈上,会发生什么,它将使用堆栈顶部存在的 UINavigationController。所以你现在得到的是
隐藏你的 TabBar,正如你所说。您也不能使用模态视图,因为它将位于所有内容之上,并阻止所有其他视图进行交互。
所以,你真正需要的是 UITabBarController 中的另一个 UINavigationController,就像这样
当你推送第二个视图时,你会得到这个
希望这可以帮助你。
As I'm about to sleep, I'm going to make some assumptions, post a solution that I hope helps you out :)
Firstly, I believe you've got a
stack.
Now, what happens if you do push the new view onto the stack is that it will use the UINavigationController that exists at the top of the stack. So what you get now is
which hides your TabBar, as you said. You can't use a Modal view either because that will sit on top of everything, and prevent all other views from getting interaction.
So, what you actually need is another UINavigationController within your UITabBarController, like so
So when you push the 2nd view, you will get this
Hope this helps you out.