tags:

views:

64

answers:

3

Is it possible to use tab bar in a view instead of window? Seems everyone add tab bar to their window.

My first screen is a login screen, which doesn't need tab bar. After user login, it change to the second screen, which contain a tabbar.

Thank you for your time :)

+1  A: 

Everything in an iPhone app is displayed in a view, which is then displayed by a window.

MHarrison
+2  A: 

I'd recommend you load your tabbar, then check for login credentials. If not found, showModal window to prompt for New Registration or Login Credentials.

Jordan
any reason for that?
kayue
A: 

Yes it's possible. You can use interface builder to add a UITabBar to whatever view you want. The view controller for the view should then implement the protocol UITabBarControllerDelegate to handle selections of tab bar items.

It's worth having a look at the template tab bar project that you can create in XCode to understand this. The view containing the tab bar is owned by the view controller - it's this view that gets added to the window in the application delegate -

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    // Add the tab bar controller's current view as a subview of the window
    [window addSubview:tabBarController.view];
}
Robert Conn