简体   繁体   中英

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. 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).

There are plenty of tutorials about iPhone apps navigation on the Web...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM