I have views with a navigation bar and a tab bar. What I would like to do is hide the tab bar on a specific view and show the tab bar again when the user changes the view.
I saw a code snippet to hide the tab bar:
-(void)makeTabBarHidden:(BOOL)hide { // Custom code to hide TabBar if ( [tabBarController.view.subviews count] < 2 ) { return; } UIView *contentView; if ( [[tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] ) { contentView = [tabBarController.view.subviews objectAtIndex:1]; } else { contentView = [tabBarController.view.subviews objectAtIndex:0]; } if (hide) { contentView.frame = tabBarController.view.bounds; } else { contentView.frame = CGRectMake(tabBarController.view.bounds.origin.x, tabBarController.view.bounds.origin.y, tabBarController.view.bounds.size.width, tabBarController.view.bounds.size.height - tabBarController.tabBar.frame.size.height); } tabBarController.tabBar.hidden = hide; }
from: http://nickwaynik.com/iphone/hide-tabbar-in-an-ios-app/
I call this in a view in which I want the tab bar to be hidden
[self makeTabBarHidden:YES]
It works great when I show / hide it in this view, but when I go back to the previous view, the tab bar is also hidden. I tried calling this function in the view viewDidUnload, viewWillDisappear, viewDidDisappear, but nothing happens. The same is true when a function is called in the previous view viewDidLoad, viewWillAppear, viewDidAppear function.
ios uitabbarcontroller uinavigationcontroller
dork Jun 17 '11 at 8:12 2011-06-17 08:12
source share