Setting hidesBottomBarWhenPushed leaves bottom bar missing after View Controller is popped(弹出视图控制器后设置 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 使底部栏丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:弹出视图控制器后设置 hidesBottomBarWhenPushed 使底部栏丢失
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
