使用 hidesBottomBarWhenPushed 时,我希望标签栏在我推送另一个视图时重新出现 [英] When using hidesBottomBarWhenPushed, i want the tab bar to reappear when i push another view

查看:15
本文介绍了使用 hidesBottomBarWhenPushed 时,我希望标签栏在我推送另一个视图时重新出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导航控制器.对于其中一个视图,我想隐藏底部标签栏,以便获得最大可能的屏幕空间.为此,我有:

I have a navigation controller. For one of the views i want to hide the bottom tab bar, so it gets the max possible screen real estate. To do this, i have:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed = YES; // To hide the tab bar
    }
    return self;
}

但是对于我推送到堆栈上的下一个视图,我希望标签栏重新出现.有没有办法做到这一点?

But for the next view that i push on the stack, i want the tab bar to reappear. Is there a way to do this?

推荐答案

可以让它重新出现,但会导致动画不正确.页面位于左侧,底部栏位于右侧.所以这可能不是你想要的行为.但是在同一个控制器中,在推入下一个视图控制器之前执行 self.hidesBottomBarWhenPushed = NO;.

One can make it reappear but it will result in an incorrect animation. Page comes in left and the bottom bar right. So it is probably not the behavior you want. But in the same controller, do self.hidesBottomBarWhenPushed = NO; before pushing the next view controller in.

这篇关于使用 hidesBottomBarWhenPushed 时,我希望标签栏在我推送另一个视图时重新出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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