[英]How can I have a view and a subview under one tab on the iphone?
Here is my situation. 这是我的情况。 I have an app with four tabs.
我有一个带有四个标签的应用。 The first tab contains a registration screen.
第一个选项卡包含注册屏幕。 Once the user is registered I want the SAME tab to load a separate "Latest News" screen instead of the registration screen.
注册用户后,我希望“相同”选项卡加载单独的“最新新闻”屏幕而不是注册屏幕。 Any help would be appreciated.
任何帮助,将不胜感激。
This sounds like a design issue. 这听起来像是一个设计问题。 It's usually a better idea to display a registration/login view as a modal view.
通常最好将注册/登录视图显示为模式视图。 So when the registration is complete, you can dismiss the modal view, and underneath your "latest news" view would already be there.
因此,完成注册后,您可以关闭模式视图,并且“最新消息”视图下将已经存在。 Most likely, you don't want your users to be able to switch to another tab in the middle of the registration process, displaying it modally would take care of that issue as well.
您很可能不希望用户在注册过程中能够切换到另一个选项卡,以模态显示它也可以解决该问题。
Don't forget that UITabBarController is a UIViewController as well. 不要忘记UITabBarController也是UIViewController。 So you can simply do:
因此,您可以简单地执行以下操作:
[tabBarController presentModalViewController:registrationController];
And when you are done, dismiss it, and make sure your latest news tab is selected. 完成后,将其关闭,并确保选择了“最新新闻”选项卡。
Use navigation controller (UINavigationController). 使用导航控制器(UINavigationController)。
There are plenty of tutorials about iPhone apps navigation on the Web... 网上有很多关于iPhone应用程序导航的教程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.