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

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

      1. <legend id='wIfYD'><style id='wIfYD'><dir id='wIfYD'><q id='wIfYD'></q></dir></style></legend>
          <bdo id='wIfYD'></bdo><ul id='wIfYD'></ul>

        防止双击 UITabBarController 时自动 popToRootViewController

        Prevent automatic popToRootViewController on double-tap of UITabBarController(防止双击 UITabBarController 时自动 popToRootViewController)
            <bdo id='Kh0LY'></bdo><ul id='Kh0LY'></ul>
                <tbody id='Kh0LY'></tbody>
              <i id='Kh0LY'><tr id='Kh0LY'><dt id='Kh0LY'><q id='Kh0LY'><span id='Kh0LY'><b id='Kh0LY'><form id='Kh0LY'><ins id='Kh0LY'></ins><ul id='Kh0LY'></ul><sub id='Kh0LY'></sub></form><legend id='Kh0LY'></legend><bdo id='Kh0LY'><pre id='Kh0LY'><center id='Kh0LY'></center></pre></bdo></b><th id='Kh0LY'></th></span></q></dt></tr></i><div id='Kh0LY'><tfoot id='Kh0LY'></tfoot><dl id='Kh0LY'><fieldset id='Kh0LY'></fieldset></dl></div>

                1. <tfoot id='Kh0LY'></tfoot>

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

                2. <legend id='Kh0LY'><style id='Kh0LY'><dir id='Kh0LY'><q id='Kh0LY'></q></dir></style></legend>
                  本文介绍了防止双击 UITabBarController 时自动 popToRootViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  UITabBarController 的默认行为是在第二次点击特定选项卡时将包含的 UINavigationController 弹出到根视图控制器.我有一个特殊的用例,我希望它不能自动工作,我很难弄清楚如何防止这种情况.

                  The default behavior of a UITabBarController is to pop the contained UINavigationController to the root view controller when a particular tab is tapped a second time. I have a particular use case where I'm wanting this to not work automatically, and I'm having a hard time figuring out how to prevent this.

                  有没有人遇到过这种情况,如果有,你做了什么?我需要继承 UINavigationController 并覆盖 popToRootViewController 还是有更简单的方法?

                  Has anyone run into this, and if so, what did you do? Do I need to subclass UINavigationController and override popToRootViewController or is there a simpler way?

                  推荐答案

                  使用tabBarController:shouldSelectViewController: 方法/ios/#documentation/uikit/reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITabBarControllerDelegate/" rel="noreferrer">UITabBarControllerDelegate 协议.

                  Use the tabBarController:shouldSelectViewController: method of the UITabBarControllerDelegate protocol.

                  - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
                      return viewController != tabBarController.selectedViewController;
                  }
                  

                  不要忘记将标签栏控制器的委托设置为实际实现此委托方法的对象.

                  Don't forget to set the delegate of the tab bar controller to the object that actually implements this delegate method.

                  这篇关于防止双击 UITabBarController 时自动 popToRootViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  UIImageView Gestures (Zoom, Rotate) Question(UIImageView 手势(缩放、旋转)问题)
                  Responsive website on iPhone - unwanted white space on rotate from landscape to portrait(iPhone上的响应式网站-从横向旋转到纵向时不需要的空白)
                  How to rotate an image 90 degrees on iOS?(如何在 iOS 上将图像旋转 90 度?)
                  How to capture current view screenshot and reuse in code? (iPhone SDK)(如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK))
                  iOS 6 shouldAutorotate: is NOT being called(iOS 6 shouldAutorotate: 没有被调用)
                  What is the PastryKit Framework?(PastryKit 框架是什么?)
                    <bdo id='LoayM'></bdo><ul id='LoayM'></ul>
                      <tbody id='LoayM'></tbody>
                    • <legend id='LoayM'><style id='LoayM'><dir id='LoayM'><q id='LoayM'></q></dir></style></legend>
                      <tfoot id='LoayM'></tfoot>

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

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