弹出视图控制器后设置 hidesBottomBarWhenPushed 使底部栏丢失 [英] Setting hidesBottomBarWhenPushed leaves bottom bar missing after View Controller is popped

查看:10
本文介绍了弹出视图控制器后设置 hidesBottomBarWhenPushed 使底部栏丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:

标签栏应用.在一个标签上有一个导航控制器.

A tab bar app. On one tab there is a navigation controller.

我的工作流程:

当我将新的 viewController 推送到导航控制器堆栈时,我设置了 hidesBottomBarWhenPushed 属性.

When I push a new viewController onto the navigation controller stack, I set the hidesBottomBarWhenPushed property.

这很好用,标签栏在新视图控制器滑动到位时被推动".

This works great, the tab bar is "pushed" as the new view controller slides in place.

问题:

当我弹出这个视图控制器并再次显示根视图控制器时,标签栏消失了.

When I pop this view controller and the root view controller is once again displayed, however, the tab bar is gone.

导航控制器已经增长到填充标签栏留下的空间.

The navigation controller has grown to fill the space left by tab bar.

是否需要设置一个属性才能使标签栏再次可见?

Is there a property I need to set to make the tab bar visible again?

我尝试过的:

手动弹出到根视图

为根视图设置(重置) hidesBottomBarWhenPushed

setting (resetting) the hidesBottomBarWhenPushed for the root view

调整根视图的大小

调整导航控制器的视图属性的大小(只留下一个空白",该标签应该在哪里)

resizing the view property of the navigation controller (just leaves a "white space" where the tab bat should be)

什么排序"起作用了:

如果我将标签栏控制器的选定索引设置为任何其他索引,则会出现标签栏.所以我知道它仍然在周围",但这对我帮助不大.

If I set the selected index of the tab bar controller to any other index, the tab bar appears. So I know it is still "around", but this does little to help me.

推荐答案

我也遇到了这个问题.我在错误的视图控制器上设置了 -hidesBottomBarWhenPushed.

I had this problem too. I was setting -hidesBottomBarWhenPushed on the wrong view controller.

错误(但似乎在你弹出之前有效):

Wrong (but seems to work until you pop):

self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];

对:

self.anotherViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];

这篇关于弹出视图控制器后设置 hidesBottomBarWhenPushed 使底部栏丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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