xcode 4.2.1 - 故事板 - 使用模式从不同视图移动并使选项卡栏可见

发布于 2025-01-04 19:56:03 字数 196 浏览 2 评论 0原文

在 xcode 故事板中,我创建了一个选项卡栏控制器,可转到 4 个不同的选项卡。其中一个选项卡是主菜单,与选项卡栏上的可用链接相同。当我使用选项卡栏移动到选项卡时,选项卡栏确实可见。但是当我使用主菜单链接时,它可以很好地适应不同的视图,但我丢失了选项卡栏。如何在不丢失选项卡栏的情况下从一个视图转到另一个视图。

我的项目中没有头文件,一切都是通过故事板完成的。

In xcode storyboard, I have created a Tab Bar Controller that goes to 4 different tabs. One of the tabs is the main menu that has the same links available at the Tab bar. When I use the tab bar to move to the tabs, I do have the tab bar visible. But when I use the main menu links it goes fine to the different views but I lose the tab bar. How can I go from view to other view without losing the tab bar.

I have no header files in my project everything is done through storyboard.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫多说 2025-01-11 19:56:03

您必须为用作菜单的视图创建一个类实现文件,在其中您需要创建一个按下按钮时调用的函数。在这些函数中,您应该调用以下内容:

 // Change 0 to the tab index that you want to display.
 [self.tabBarController setSelectedIndex:0];

 // Change theAppropriateViewController to the view controller that you want to display.
 [self.tabBarController setSelectedViewController:theAppropriateViewController];

You have to create a class implementation file for the view that you are using as a menu, in it you need to create a function that is called when you press the buttons. In those functions, you should call the following:

 // Change 0 to the tab index that you want to display.
 [self.tabBarController setSelectedIndex:0];

or

 // Change theAppropriateViewController to the view controller that you want to display.
 [self.tabBarController setSelectedViewController:theAppropriateViewController];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文