gpt4 book ai didi

iOS TabbarViewController 隐藏标签栏

转载 作者:IT王子 更新时间:2023-10-29 07:56:49 28 4
gpt4 key购买 nike

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

self.tabBar.hidden = YES;

选项卡栏消失了,但 View 底部有一个空白区域(蓝色区域)。我不想要空白区域,我该如何解决?谢谢你。

编辑:蓝色区域是:

self.view.backgroundColor = [UIColor blueColor];

最佳答案

我们在我们的应用程序中做了完全相同的事情。要隐藏默认的 TabBar,只需覆盖父 View Controller (或应用程序中的每个 View Controller )中的 hidesBottomBarWhenPushed 方法

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

编辑:这个值也可以从 Storyboard 中设置:

enter image description here

关于iOS TabbarViewController 隐藏标签栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15296065/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com