swift - How to implement both UIViewController stack behaviour
问题描述
I noticed that WhatsApp has a somewhat neat navigation behaviour on their iOS app. See the following:
There are two navigation stack behaviour here:
UINavigationController
as a child ofUITabBarController
UITabBarController
as a child ofUINavigationController
How to achieve both of this at the same time, just like WhatsApp? Does it uses a custom UINavigationController
?
Currently my implementation only does number 2 and not number 1. I do know that to do number 1 I have to make the UINavigationController
as a child of UITabBarController
, but I will lose number 2.
However if I implemented both, I will get weird result where I get two navigation bar, like:
解决方案
在您给出的示例中,看起来他们有一个UITabBarController
作为根视图控制器。Settings 是导航控制器内的视图控制器。
当您点击Data & Storage时,它会将另一个视图控制器推送到设置导航控制器的堆栈中。
当您按下帮助时,它会执行相同的操作 - 但当帮助视图控制器被推入堆栈时,选项卡栏会隐藏。
推/退时请参阅隐藏/显示标签栏。迅速采取一些方法来做到这一点
推荐阅读
- python - pandas 中的 groupby 和函数调用
- node.js - Electron 应用程序无法解析任何添加到 webpack 外部的节点模块
- yocto - BeagleBone 无法使用 systemd 启动
- javascript - 如何检查 Jquery 是否正确保存和嵌入?
- node.js - 如何在nodejs中将变量写入我的JS文件而不评估其值
- environment - 如何从 ExternalStorage 和多字体设置字体
- python - 图像生成器缺少 unet keras 的位置参数
- javascript - 使用 ng-template 清空原生元素
- javafx - 是否可以在 Querydsl (DerbyDB) 中调用存储过程
- ruby-on-rails - Ruby:-- 接受数组作为输入并将其放入散列