iOS TabbarViewController隐藏标签栏 [英] iOS TabbarViewController hide the tab bar

查看:489
本文介绍了iOS TabbarViewController隐藏标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个viewcontroller它实现了UITabbarViewController,我想隐藏
标签栏并自己覆盖它,

I have a viewcontroller that it implement UITabbarViewController, and I want to hide the tab bar and override it by myself,

self.tabBar.hidden = YES;

标签栏消失但是视图底部有一个空白区域(蓝色区域) 。
我不想要空白区域,我该如何解决这个问题?谢谢。

the tab bar disappeared BUT there is a blank area(the blue one) at the bottom of the view. I dont want the blank area , how can I fix this? Thank you.

编辑:蓝色区域为:

self.view.backgroundColor = [UIColor blueColor];


推荐答案

我们在应用程序中完成了相同的操作。要隐藏默认TabBar,只需覆盖父视图控制器(或应用程序中每个视图控制器)中的 hidesBottomBarWhenPushed 方法

We've done exactly the same in our application. To hide the default TabBar, simply override the hidesBottomBarWhenPushed method in your parent view controller (or in every view controller in your App)

#pragma mark - Overriden UIViewController methods
- (BOOL)hidesBottomBarWhenPushed {
    return YES;
}

编辑:此值也可以从故事板中设置:

This value can also be set from Storyboard:

这篇关于iOS TabbarViewController隐藏标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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