<tfoot id='VHttC'></tfoot>

      <legend id='VHttC'><style id='VHttC'><dir id='VHttC'><q id='VHttC'></q></dir></style></legend>

        <small id='VHttC'></small><noframes id='VHttC'>

        • <bdo id='VHttC'></bdo><ul id='VHttC'></ul>
      1. <i id='VHttC'><tr id='VHttC'><dt id='VHttC'><q id='VHttC'><span id='VHttC'><b id='VHttC'><form id='VHttC'><ins id='VHttC'></ins><ul id='VHttC'></ul><sub id='VHttC'></sub></form><legend id='VHttC'></legend><bdo id='VHttC'><pre id='VHttC'><center id='VHttC'></center></pre></bdo></b><th id='VHttC'></th></span></q></dt></tr></i><div id='VHttC'><tfoot id='VHttC'></tfoot><dl id='VHttC'><fieldset id='VHttC'></fieldset></dl></div>

        隐藏导航栏,取决于视图控制器的显示方式

        Set navigation bar hidden, depending on how the view controller appeared(隐藏导航栏,取决于视图控制器的显示方式)
        <tfoot id='aBCUi'></tfoot>
            <i id='aBCUi'><tr id='aBCUi'><dt id='aBCUi'><q id='aBCUi'><span id='aBCUi'><b id='aBCUi'><form id='aBCUi'><ins id='aBCUi'></ins><ul id='aBCUi'></ul><sub id='aBCUi'></sub></form><legend id='aBCUi'></legend><bdo id='aBCUi'><pre id='aBCUi'><center id='aBCUi'></center></pre></bdo></b><th id='aBCUi'></th></span></q></dt></tr></i><div id='aBCUi'><tfoot id='aBCUi'></tfoot><dl id='aBCUi'><fieldset id='aBCUi'></fieldset></dl></div>

            1. <legend id='aBCUi'><style id='aBCUi'><dir id='aBCUi'><q id='aBCUi'></q></dir></style></legend>

                <tbody id='aBCUi'></tbody>

              1. <small id='aBCUi'></small><noframes id='aBCUi'>

                  <bdo id='aBCUi'></bdo><ul id='aBCUi'></ul>
                • 本文介绍了隐藏导航栏,取决于视图控制器的显示方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在其中一个选项卡中有一个带有导航控制器的选项卡栏.目前,导航控制器的根视图没有显示导航栏,并且通过

                  I have a tab bar with a navigation controller in one of the tabs. Currently the root view of the navigation controller doesnt have the nav bar showing and animates nicely into the subviews by

                  - (void)viewDidLoad {
                     ...
                     [self.navigationController setNavigationBarHidden:YES animated:NO];
                     ...
                  }
                  

                  - (void)viewWillAppear:(BOOL)animated {
                      [self.navigationController setNavigationBarHidden:YES animated:YES];
                  }
                  
                  - (void)viewWillDisappear:(BOOL)animated {
                      [self.navigationController setNavigationBarHidden:NO animated:YES];
                  }
                  

                  当然,更改选项卡会启动 viewWillAppear 功能,因此当我返回根视图时,导航栏会滑开,而不是不存在.

                  But of course changing tabs initiates the viewWillAppear function and so as I go back to the root view the navigation bar slides away, rather than just not being there.

                  有没有一种方法可以隐藏根视图上的导航栏而不对其进行动画处理,除非从导航堆栈上的子视图中出现?

                  Is there a way that I can hide the nav bar on the root view without animating it except for when appearing from a subview on the navigation stack?

                  推荐答案

                  viewWillAppear:animated 上的 (BOOL)animated 参数.更改选项卡时,它会以 NO 的形式出现,因为动画是即时的.另一方面,如果使用 animated:YES 从导航堆栈中推送弹出,那么它将作为YES.

                  The (BOOL)animated parameter on viewWillAppear:animated. When changing Tabs, it will come as NO, since the animation is immediate. On the other hand, if it's being pushed or popped from the navigation stack with animated:YES, then it will come as YES.

                  虽然这看起来像个 hack,但它是正确的方法:你不需要弄清楚谁是调用者,相反,专注于这样一个事实:如果你的视图控制器会显示动画,你有时间做你自己的动画,如果没有,就把它搞砸,立即显示(或在这种情况下,隐藏)所有内容.

                  Although this looks like a hack, it's the correct way: you don't need to figure out who was the caller, instead, focus on the fact that if your view controller will appear animated, you have time to do your own animations, if not, screw it, show (or in this case, hide) everything immediately.

                  这篇关于隐藏导航栏,取决于视图控制器的显示方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
                  <legend id='x7ygZ'><style id='x7ygZ'><dir id='x7ygZ'><q id='x7ygZ'></q></dir></style></legend>

                  1. <i id='x7ygZ'><tr id='x7ygZ'><dt id='x7ygZ'><q id='x7ygZ'><span id='x7ygZ'><b id='x7ygZ'><form id='x7ygZ'><ins id='x7ygZ'></ins><ul id='x7ygZ'></ul><sub id='x7ygZ'></sub></form><legend id='x7ygZ'></legend><bdo id='x7ygZ'><pre id='x7ygZ'><center id='x7ygZ'></center></pre></bdo></b><th id='x7ygZ'></th></span></q></dt></tr></i><div id='x7ygZ'><tfoot id='x7ygZ'></tfoot><dl id='x7ygZ'><fieldset id='x7ygZ'></fieldset></dl></div>

                          <tfoot id='x7ygZ'></tfoot>
                            <tbody id='x7ygZ'></tbody>

                          <small id='x7ygZ'></small><noframes id='x7ygZ'>

                            <bdo id='x7ygZ'></bdo><ul id='x7ygZ'></ul>