设置hidesBottomBarWhenPushed在弹出View Controller之后,留下底部栏 [英] Setting hidesBottomBarWhenPushed leaves bottom bar missing after View Controller is popped

查看:325
本文介绍了设置hidesBottomBarWhenPushed在弹出View Controller之后,留下底部栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:



一个标签栏应用程序。
在一个选项卡上有一个导航控制器。



我的工作流程:



新的viewController到导航控制器堆栈,我设置了hidesBottomBarWhenPushed属性。



这很好,标签栏是推,因为新的视图控制器滑动到位。 / p>

问题:



然而,当我弹出这个视图控制器并且再次显示根视图控制器时,



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

是否有一个属性,我需要设置使选项卡栏再次显示?






我尝试了:



手动弹出到根视图



设置(重置)根视图的hidesBottomBarWhenPushed



调整根视图的大小



调整导航控制器的视图属性(只留下tab空格)



sorta的工作原理:



如果我将标签栏控制器的选定索引设置为任何其他索引,将出现选项卡栏。所以我知道它仍然是周围,但这对我没有帮助。

解决方案

我在错误的视图控制器上设置-hidesBottomBarWhenPush。



错误(但似乎工作,直到你弹出):

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

右:

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


I have the following setup:

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

My workflow:

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.

The problem:

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?


What I have tried:

popping to the root view manually

setting (resetting) the hidesBottomBarWhenPushed for the root view

resizing the root view

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

What "sorta" worked:

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.

解决方案

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];

Right:

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

这篇关于设置hidesBottomBarWhenPushed在弹出View Controller之后,留下底部栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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