隐藏横向中的Tabbar而不推送到NavigationController [英] Hide Tabbar in Landscape without pushing to NavigationController

查看:62
本文介绍了隐藏横向中的Tabbar而不推送到NavigationController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在横向中显示没有Tabbar的另一个视图。
所以我创建一个新视图,只更改 self.view

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?

推荐答案

只需在 viewWillAppear中添加此行:隐藏视图的方法 UITabBar

just add this line in your viewWillAppear: method of your view for hide UITabBar

[self.tabBarController.tabBar setHidden:YES];

和设置新视图作为RootViewController只需使用下面的代码......

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];

这篇关于隐藏横向中的Tabbar而不推送到NavigationController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆