views:

345

answers:

2

Hello,

I will try to explain myself as best as possible, I know the title does not say much. Basically i have 4 Navigation Controllers embedded in Tab Bar Controller.

What I want to do is have one of this Navigation Controllers push a new Navigation Controller embeded in aTab Bar Controller dismissing the original Tab Bar Controller. When the user clicks the back Button on the Navigation Controller the original Tab Bar Controller is called.

I tried simply pushing the new Tab Bar Controller in the Navigation Controller, but of course i get now 2 tab bars in my view. At the moment what I am doing is having the navigation controller present my new Tab Bar Controller as a modal View and it works Ok. But I do not have the back button in the Navigation Controller so at the moment I just dismiss my Modal View, which I guess is kinda the same.

I have this in code:

myTabBarController = [[UITabBarController alloc] init]; myTabBarController.viewControllers = [NSArray arrayWithObjects:myNewsNavController, mostPopularController, myAboutNavController, nil];

Where myNewsNavController is Navigation Controller containing a View Controller linked to a TableView then when the user tabs the accesoryButton it presents the modal Controller at the moment.

But I think the user experience would be better if there was a back button instead.

So how can I dismiss the Tab Controller? and then when dismissing the modal view have it back again?. Any help will be Greatly appreciated. Thank you.

-Oscar

A: 

I'm not sure exactly what you want, but have you tried setting

myViewController.hidesBottomBarWhenPushed = YES

?

Amagrammer
That is exactly what I wanted!!. Thank you so much, can't believe I didn't see that property.
OscarMk
A: 
ControllerToShow *controller = [[ControllerToShow alloc] init];
controller.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:controller animated:YES];
[controller release];

You have to set hidesBottomBarWhenPushed = YES on the controller you are going to push into the view...

Fossli