I am building a view programmatically from a tableview which has a bottom tab bar. I would like this bottom bar to disappear when a table cell is selected. I can do that using:
self.tabBarController.tabBar.hidden = YES;
but the size of the view remains as if the tabbar was still there. I see that if the view is built on the storyboard and by setting the checkmark "Hides bottom bar on push", the view resizes to occupy the space left free by the tabbar. How can I do that programmatically?
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];
and for a specific view controller which your pushing. use this code
TheViewController* theController = [[TheViewController alloc] initWithNibName:@"TheViewController" bundle:nil];
theController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:theController animated:YES];
[theController release];
now the tabbar will be hidden and shown autometically. enjoy the time :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With