简体   繁体   English

如何显示底栏(标签栏控制器)?

[英]How to SHOW bottombar (tab bar controller)?

I used this to hide the bottom bar 我用它来隐藏底部的酒吧

-(BOOL) hidesBottomBarWhenPushed{
    return YES;
}

Now i'm at a point where I want to NOT to hide it anymore. 现在,我要不要再隐藏它了。 What method should I use? 我应该使用什么方法?

Thanks 谢谢

Take at look at Elements sample project. 看一下Elements示例项目。 They do something like you want, especially in the ElementViewController.m file. 它们执行所需的操作,尤其是在ElementViewController.m文件中。

那很简单,只需使用以下命令:

[tabBar setHidesBottomBarWhenPushed:FALSE];

It took me some time putting the puzzle of John together. 我花了一些时间来解决约翰的困惑。 So here is my final result. 这是我的最终结果。 In the .m file of my view controller I add this code: 在我的视图控制器的.m文件中,添加以下代码:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Custom initialization
    self.hidesBottomBarWhenPushed = YES;
}
return self;}

Because I use a nib file I had to override the initWithNibName method. 因为我使用笔尖文件,所以我不得不重写initWithNibName方法。

A really simple way: 一个非常简单的方法:

 Class *instanceName = [[Class alloc] init];
 instanceName.hidesBottomBarWhenPushed = YES;
 ...
 [navigationController pushViewController:instanceName animated:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM