How to install programmatically "Hides the lower bar when pressed"?

I create a view programmatically from a table that has a bottom tab bar. I would like this bottom panel to disappear when a table cell is selected. I can do this using:

self.tabBarController.tabBar.hidden = YES;

but the size of the view remains as if the tab was still there. I see that if the view is built on a storyboard and by checking "Hide the bottom panel when clicked", the window will be resized to take up space that is not tabbed. How can I do this programmatically?

+3
source share
1 answer
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];

and for the specific view controller that you click on. use this code

    TheViewController* theController = [[TheViewController alloc] initWithNibName:@"TheViewController" bundle:nil];
    theController.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:theController animated:YES];
    [theController release];

. :)

+10

All Articles