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 使底部栏丢失


- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01