在推动UIView时隐藏UITabBar [英] Hiding UITabBar when pushing a UIView

查看:74
本文介绍了在推动UIView时隐藏UITabBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UITabBarController ,其中默认视图控制器是 UINavigationController 。我希望能够在 UINavigationController 中推送某个视图时隐藏UITabBarController的UITabBar。

I have a UITabBarController where the default view controller is a UINavigationController. I want to be able to hide the UITabBar of the UITabBarController when I push a certain view in the UINavigationController.

我试过添加:

delegate.tabBarController.hidesBottomBarWhenPushed = YES;

,但这似乎没有诀窍。

in my UINavigationController before I push the view, but that doesn't seem to do the trick.

关于我应该做什么或者是否可能的任何提示?提前致谢!

Any tips on what I should be doing or if it's even possible? Thanks in advance!

推荐答案

这样更好:

viewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:viewController animated:YES];

您必须在要进入视图的控制器上设置hidesBottomBarWhenPushed = YES ...

You have to set hidesBottomBarWhenPushed = YES on the controller you are going to push into the view...

这篇关于在推动UIView时隐藏UITabBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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