tags:

views:

64

answers:

1

HI all, i am having navigation based application, in which i need too implement tab bars ,in one of view. in one view i need 5 tabs, can any one please suggest me to create tab bars programmatically,, ? each tab should navigate to another xib.

Suggestions are always appreciated. regards

+1  A: 

Here is a sample code from Apple to create tab bar programmatically:

- (void)applicationDidFinishLaunching:(UIApplication *)application {
   tabBarController = [[UITabBarController alloc] init];

   MyViewController* vc1 = [[MyViewController alloc] init];
   MyOtherViewController* vc2 = [[MyOtherViewController alloc] init];

   NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, nil];
   tabBarController.viewControllers = controllers;

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

More here

vodkhang
@vodkhang...dat was perfect man..this is wat i was looking for.thanks a ton man
shishir.bobby