Quote:
Originally Posted by DenVog
I would appreciate a tutorial for combining Tab Bar and Nav Bar into a single multiview application (e.g. iPod application with Nav bar at top and tab bar at bottom). I've seen tutorials on each independently, and I'm able to get those to work if I start with the appropriate Xcode template. Trying to combine the two is quite confusing though. Is it easier to start with a Tab Bar application template and add the navigation controller code, or vice versa?
|
Hi,
To add a navigation bar to your tabbar application is easy, all you have to do is
create an instance of :
UINavigationController *mynavcontroller;
in your ViewController ".h" file
then in your ".m" file in the ViewDidLoad method add this:
mynavcontroller = [[UIViewController alloc] init];
[self.view addSubView:mynavcontroller];
To add a new veiw to the navigationController do the following:
[self.navigationController pushViewController:yourviewcontroller animated:YES];