xcode无法隐藏tabbarcontroller
我有一个 tabbarcontroller 作为主控制器,当推送视图时我想隐藏它。我使用 hidesBottomBarWhenPushed 但不起作用。谢谢。
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.hidesBottomBarWhenPushed = YES;
}
return self;
}
I have a tabbarcontroller as main controller and when a view is pushed I would like to hide it. I use hidesBottomBarWhenPushed but not working. Thanks.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.hidesBottomBarWhenPushed = YES;
}
return self;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您推送此控制器时,尝试在其父视图控制器中添加此行:
祝你好运
try to add this line when you push this controller, in it's parent view controller :
Good Luck
仅当 tabBarController 的 viewController 之一是 UINavigationController 时,这才有效。仅当视图控制器被推送到 UINavigationController 的堆栈上时,才会考虑 hidesBottomBarWhenPushed 属性,并且如果它是根视图控制器,则不会执行太多操作。
This will only work if one of the viewControllers of the tabBarController is a UINavigationController. The
hidesBottomBarWhenPushed
property is only respected if a view controller is pushed onto the stack of a UINavigationController and will not do much if it is the root view controller.我已经实现了自己的自定义 tabBarController (它扩展了原始的 UITabBarController ),因为我需要在某些情况下(例如设备旋转)以编程方式切换栏,这是我的实现(注释解释了它是如何工作的) :
I've implemented my own custom tabBarController (which extends the original UITabBarController), because I need to toggle bars programmatically under certain circumstances (like device rotation), this is my implementation (comments explain how it works):