ios - 推送 UIView 时隐藏 UITabBar

标签 ios objective-c swift uitabbarcontroller uinavigationbar

我有一个 UITabBarController,其中默认 View Controller 是一个 UINavigationController。当我在 UINavigationController 中推送某个 View 时,我希望能够隐藏 UITabBarController 的 UITabBar。

我试过添加:

delegate.tabBarController.hidesBottomBarWhenPushed = YES;

在我推送 View 之前在我的 UINavigationController 中,但这似乎并没有起到作用。

关于我应该做什么或什至可能的任何提示?提前致谢!

最佳答案

这样更好:

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

您必须在要插入 View 的 Controller 上设置 hidesBottomBarWhenPushed = YES...

关于ios - 推送 UIView 时隐藏 UITabBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/675887/

相关文章:

html - 在Xcode中解析XML文件时删除HTML标记

ios - 如何在运行时在 TabBarcontroller 中安排标签栏项目?

Swift - 将核心数据与 Cocoa 结合使用

ios - UIView 扩展中的 UIButton

ios - Xcode 只能看到写在单独文件中的嵌套类的一些类似扩展

ios - 快速调用 Objective-c 函数

objective-c - "Receiver type ' CALayer' 例如消息是前向声明”是什么意思?

ios - 表脚 View 按钮

html - stringByReplacingOccurrencesOfString 无法正常运行

ios - 如何在 Swift 中使用 accessoryType?