Possible Duplicate:
Tab Bar Application With Navigation Controller
My Xcode version is 4.3.2. i Want to add navigation bar in tabbar based application.
Thanks
Possible Duplicate:
Tab Bar Application With Navigation Controller
My Xcode version is 4.3.2. i Want to add navigation bar in tabbar based application.
Thanks
In your applicationDidFinishLaunching
method you can see something like
FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
.
.
.
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:firstViewController, secondViewController, nil];
Add the object of FirstViewController
to UINavigationController
object as below
UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
.
.
.
//And in the tabbarController array add the navigationController Object instaed if FirstViewControllerObject
self.tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavController, secondViewController, nil];
And its done. Now your FirstViewController
will be treated as navigationController and it will have navigationbar.
Edit
If you Just want the navigation bar then you can either insert it from xib
or add the UINavigationBar
as a subview in self.view