Hide Tabbar in Landscape without pushing to NavigationController

余生长醉 提交于 2019-12-12 14:13:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!