ios - 插入导航堆栈时隐藏 TabBar,弹出导航堆栈时将其恢复

标签 ios objective-c swift uitabbarcontroller uitabbar

我正在尝试执行以下操作。

我有一个标签栏 Controller ,里面有 2 个标签。这两个选项卡都是导航 Controller ,每个选项卡上都有一个表格 View 。

现在当我在第一个选项卡中选择表格的一个单元格时,我正在插入另一个选项卡栏 Controller ,所以我想隐藏父 tabbarcontroller 的选项卡栏,当我单击导航栏上的后退按钮时我想再次看到父标签栏,因为我在我的父标签栏 View 中。

我尝试了 hidesbottombarwhenpushed 并且它隐藏了父选项卡栏 Controller 选项卡栏但是当我单击返回时它不会将它带回来。

最佳答案

好吧,最后我得到了答案,这就是我应该做的。

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

所以基本上 hidesBottomBarWhenPushed = YES,然后推送你的 View Controller ,然后 hidesBottomBarWhenPushed = NO;这就像一个魅力。

感谢eddy和他的帖子 here

关于ios - 插入导航堆栈时隐藏 TabBar,弹出导航堆栈时将其恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4982373/

相关文章:

ios - 以编程方式在 iPhone 上调用紧急电话

ios - 如何拍照并同时保存(swift3)

ios - 计时器被触发两次但未被取消

objective-c - 使用 C 或 Obj-C 中的 X509 和 PKCS#8 编码的 OpenSSL RSA key 对

swift - 在 Swift 中重写初始化器

ios - ResearchKit 中的安全文本输入 ORKAnswerFormat

iOS 编辑来自 App 的推送通知声音

ios - (Xcode 8 swift 3)。将自定义键盘扩展与特定文本字段一起使用

objective-c - NSMutableArray 作为实例变量

c# - Objective-C 等效于 C# 中的 'as' 运算符