iPhone:TabBarController作为导航控制器的第二级 [英] iPhone: TabBarController as second level of Navigation Controller

查看:65
本文介绍了iPhone:TabBarController作为导航控制器的第二级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone开发的新手.

I'm new to iphone development.

我已经阅读了有关在窗口上实现标签栏控制器(例如,作为应用程序的主控制器)的教程.但是,如何将标签栏控制器创建为可以由导航栏控制器调用的独立" UIViewController?

I've read tutorials about implementing a tab bar controller on the window (eg as the main controller for the app). But how can I create a tab bar controller as a 'standalone' UIViewController that can be called by a navigation bar controller?

基本上,我的导航栏控制器具有一个UIViewControllers数组,它将显示在表中,然后在用户选择一个项目时加载适当的视图/控制器.

Basically my navigation bar controller has an array of UIViewControllers that it displays in the table and then loads the appropriate view/controller when a user selects an item.

现在,我希望这些已加载的视图/控制器之一成为选项卡栏控制器.我该怎么办?

Now I want one of these loaded views/controllers to be a tab bar controller. How can I do this?

我不确定如何在应用程序委托中没有插座/实例的情况下独自创建标签栏控制器.

I'm not sure how to create a tab bar controller on its own without having an outlet/instance in the application delegate.

希望如此.谢谢.

推荐答案

尽管先前的答案是正确的,但我想指出苹果对此不满意:

Although previous answer was is correct, I'd just like to point out that Apple won't be happy with this:

您永远不想将标签栏控制器推入导航控制器的导航堆栈中.这样做会造成一种不寻常的情况,即只有当特定视图控制器位于导航堆栈的顶部时,选项卡栏才会出现.标签栏设计为持久性的,因此这种短暂的方法可能会使用户感到困惑.

You never want to push a tab bar controller onto the navigation stack of a navigation controller. Doing so creates an unusual situation whereby the tab bar appears only while a specific view controller is at the top of the navigation stack. Tab bars are designed to be persistent, and so this transient approach can be confusing to users.

引用来自: Apple View Controller编程指南

阅读人机界面指南,您的应用可能因违反界面规则"而被拒绝.此外,您还必须手动处理所有vieWillAppear/Disappear等.我很确定还有另一种设计界面的方法.

Read Human Interface Guidelines, your app might be rejected for "breaking the interface rules". What's more, you'll also have to handle all the vieWillAppear/Disappear etc manually. I'm pretty sure there's another way of designing the interface.

关于, 保罗

这篇关于iPhone:TabBarController作为导航控制器的第二级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆