问题
I want to show another view without Tabbar in Landscape.
So I create a new view and only change the self.view
and
self.hidesBottomBarWhenPushed = YES;
But it doesn´t work for me. Hope someone can help?
回答1:
just add this line in your viewWillAppear:
method of your view for hide UITabBar
[self.tabBarController.tabBar setHidden:YES];
and for set new view as a RootViewController just use below code...
YourNewViewController *objView = [[YourNewViewController alloc] initWithNibName:@"YourNewViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:objView];
[self presentModalViewController:nav animated:YES];
回答2:
if you don't want to push navigationController, then try this code :
UINavigationController *navAddEvent = [[UINavigationController alloc] initWithRootViewController:yourObg];
navAddEvent.navigationBar.hidden = TRUE;
[self presentModalViewController:navAddEvent animated:YES];
来源:https://stackoverflow.com/questions/13839038/hide-tabbar-in-landscape-without-pushing-to-navigationcontroller