在单独的视图中显示 UITabBar

发布于 2024-10-08 04:43:40 字数 414 浏览 5 评论 0原文

我是 Xcode/Cocoa/Objective-C 的新手,我需要一些帮助。

本质上,我正在开发一个应用程序,其中第一个窗口有几个按钮;这是主菜单。按下按钮时,将打开一个单独的视图,该视图在顶部有一个 UITabBar 和一个导航栏,可返回主菜单。

我的两个问题:

  1. 如何使 UITabBar 仅出现在某些视图中?

  2. 如何创建一个按钮来在 nib 文件之间切换,而不仅仅是视图?

我一直在使用 RootViewController 和 TabBarController 类供我的 RootView.xib (这是包含按钮的主菜单)和几个用于选项卡栏视图的 .xib 文件(一个 nib 文件包含两个视图中的每一个)对于标签栏和导航栏)。

我真的很感激任何帮助!

I'm new to Xcode/Cocoa/Objective-C, and I need a little help.

Essentially, I'm working on an app in which the first window has a couple of buttons; this is the Main Menu. When pressed, a button opens up a separate view that has a UITabBar and a Navigation Bar at the top that leads back to the Main Menu.

My two questions:

  1. How do you make a UITabBar appear only in certain views?

  2. How do you create a button to switch between nib files and not only views?

I've been using a RootViewController and TabBarController classes to be used by my RootView.xib (which is the main menu that holds the buttons) and a couple .xib files for the tab bar views (one nib file has each of the two views for the tab bars and nav bar).

I'd really appreciate any help with this!

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

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

发布评论

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

评论(1

音栖息无 2024-10-15 04:43:41

在您的 appDelegate 中使用按钮模式呈现您的视图。当您关闭此视图时,请使用 setSelectedViewController: 作为 TabBarControllers 数组中的 rootController 设置视图控制器。

希望这有帮助

present your view with buttons modaly in your appDelegate. When you dismiss this view set a view controller with setSelectedViewController: as rootController in your TabBarControllers array.

Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文