选项卡栏不能作为另一个视图的子视图,但作为窗口的子视图可以正常工作?

发布于 2024-08-01 13:01:45 字数 322 浏览 1 评论 0原文

我正在尝试制作一个在标题屏幕后包含三个子视图的程序。 其中两个视图只是标准 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 技术交流群。

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

发布评论

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

评论(1

暗喜 2024-08-08 13:01:45

您无法将标签栏控制器推送到导航控制器,我认为这就是您想要做的。 但是,您可以使用普通的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 a UIViewController subclass (rather than a UITabBarController). See this related question.

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