在单独的视图中显示 UITabBar
我是 Xcode/Cocoa/Objective-C 的新手,我需要一些帮助。
本质上,我正在开发一个应用程序,其中第一个窗口有几个按钮;这是主菜单。按下按钮时,将打开一个单独的视图,该视图在顶部有一个 UITabBar 和一个导航栏,可返回主菜单。
我的两个问题:
如何使 UITabBar 仅出现在某些视图中?
如何创建一个按钮来在 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:
How do you make a UITabBar appear only in certain views?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 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