简体   繁体   English

呈现其他视图时如何自动隐藏标签栏

[英]How to auto hide the tab bar when presenting other view

Is there anybody used the IM software called QQ (popular in China)? 是否有人使用过称为QQ(在中国很受欢迎)的IM软件? This software has an tab bar and it has 5 tabs. 该软件具有一个标签栏,并且具有5个标签。 In each tab there is a navigation controller, like this: 每个选项卡中都有一个导航控制器,如下所示:

QQ主界面

In the second tab when tap any of the first three table view cell this tab's view will transit to an other view in normal way, that is the transition happen within the tab bar controller. 在第二个选项卡中,当点击前三个表视图单元格中的任何一个时,该选项卡的视图将以正常方式转换到另一个视图,即在选项卡栏控制器内发生转换。

以正常方式过渡到其他视图

When tap any of the last three table view cell this tab's view will also transit to an other view but meanwhile the tab bar will transit together with the view controller too. 当点击最后三个表格视图单元格中的任何一个时,该选项卡的视图也将切换到另一个视图,但与此同时,选项卡栏也将与视图控制器一起转换。

使用标签栏过渡到其他视图

This is very strange! 这很奇怪! According to the first situation we can guess that the navigation controller is the child of the tab bar controller, but according to the second situation the tab bar may be the child of navigation controller, right? 根据第一种情况,我们可以猜测导航控制器是选项卡栏控制器的子项,但是根据第二种情况,选项卡栏可能是导航控制器的子项,对吗? Anybody knows how to implement this UI? 有人知道如何实现此UI吗? Thank you in advance! 先感谢您!

Thanks god! 感谢上帝! The answer is set the hidesBottomBarWhenPushed property of the view controller pushed into navigation controller stack to YES. 答案是将推入导航控制器堆栈中的视图控制器的hidesBottomBarWhenPushed属性设置为YES。

屏幕截图中的标签栏不必是标签栏,它可以是视图控制器上的自定义视图,当标签栏需要大量更改时,我使用了类似的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM