选项卡栏不能作为另一个视图的子视图,但作为窗口的子视图可以正常工作?
我正在尝试制作一个在标题屏幕后包含三个子视图的程序。 其中两个视图只是标准 nib 文件,通过 UIViewController 子类化来控制它们,第三个是选项卡栏视图。 我似乎无法显示标签栏项目。 我浏览了“开始 iPhone 开发”中的选项卡栏章节,该章节立即将选项卡栏控制器添加为应用程序委托中窗口的子视图,并且效果很好。 我想做的是在从标题屏幕中选择第三部分后加载我的 rootView 控制器,然后向其中添加一个选项卡栏视图。 每次我这样做时,我都会得到一个空白的选项卡栏,没有选项卡栏项目。
鉴于我已经为此工作了几天,因此您能提供的任何帮助将不胜感激。
谢谢
I am trying to make a program with three subviews after the title screen. Two of the views are just standard nib files with UIViewController subclassed to control them, and the third is a Tab Bar view. I can't seem to get the tab bar items to display though. I walked through the Tab bar chapter in "Beginning iPhone Development" which adds the Tab Bar Controller right off the bat as a subview of Window in the app delegate and that works fine. What I want to do though is load up my rootView controller after the third section was chosen from the title screen and then add a Tab Bar view to that. Every time I do this though I get a blank Tab Bar with no tab bar items.
Any help you can provide would be greatly appreciated seeing as I've been working at this for a few days now.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法将标签栏控制器推送到导航控制器,我认为这就是您想要做的。 但是,您可以使用普通的
UITabBar
并在UIViewController
子类(而不是UITabBarController
)中实现自己的视图切换>)。 请参阅此相关问题。You can't push a tab bar controller to a navigation controller, which I assume is what you're trying to do. However, you can use a plain
UITabBar
and implement your own view switching in aUIViewController
subclass (rather than aUITabBarController
). See this related question.