long time reader, first time asker-er?
So basically I have a tab bar application with a navigation controller for each tab (they each go down several levels of views) I'm currently hiding the tab bar when I need to using this code:
MyViewController *myVC = [[MyViewController alloc]initWithNibName:@"MyViewController" bundle:nil];
myVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:myVC animated:YES];
[myVC release];
This works fine, however in one of my tabs I haven't created the navigation controller in IB but instead, programatically
Here is the code for creating the navigation controller programatically:
UINavigationController * navigationController = [[[UINavigationController alloc] init] autorelease];
self.segmentsController = [[SegmentsController alloc] initWithNavigationController:navigationController viewControllers:viewControllers];
self.segmentedControl = [[UISegmentedControl alloc] initWithItems:[viewControllers arrayByPerformingSelector:@selector(title)]];
self.segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
[self.segmentedControl addTarget:self.segmentsController
action:@selector(indexDidChangeForSegmentedControl:)
forControlEvents:UIControlEventValueChanged];
[self.view addSubview:navigationController.view];
What I am creating here is a nav bar with a segmented control within, that pushes views, within one of the segmented control views (it's a list) when I click on a list item I want to hide the tab bar, but nothing happens using the code at the beginning of this question, I'm assuming it's something to do with how the navigation controller was made, the views push and pop just fine but that TabBar stays visible when I want to hide it, does anyone have any idea as to how I can hide this tab bar?
Thanks for any feedback in advance!
Edit: As a 'new user' I can't submit a picture to help visualise the problem, figures. Oh well hopefully what's going on here isn't too fuzzy for you guys.