If you are using the iPhone Tab Bar in your application, but you need to hide the Tab Bar in any specific situation. And you’re using TTNavigator (Three20h) to manage yours View Controllers. This is a very easy task.
Let’s assume that you want to hide the Tab Bar when push the view to the controller. Follow this steps:
- First, add the TTNavigatorDelegate to your class.
- Second, add your class as delegate of TTNavigator. One good place to put this code is your initmethod:
// Delegation from TTNavigator.
[[TTNavigator navigator] setDelegate:self];
- Third, add the method navigator:willOpenURL:inViewController: to your code.
This method will be called before the view been pushed. So you have enough time to
configure some properties of him. The property that we want to edit is the
hidesBottomBarWhenPushed. So we’ll have this piece of code:
-(void)navigator:(TTBaseNavigator *)navigator
willOpenURL:(NSURL *)URL
inViewController:(UIViewController *)controller
{
controller.hidesBottomBarWhenPushed = YES;
}
You’re done. This code wil hide the Tab Bar when the view has been pushed and
automatically will show the Tab Bar back when the view has been popped.