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

        <bdo id='hbSDk'></bdo><ul id='hbSDk'></ul>
      <legend id='hbSDk'><style id='hbSDk'><dir id='hbSDk'><q id='hbSDk'></q></dir></style></legend>

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

      获取最顶层的 UIViewController

      时间:2023-06-10
        <tbody id='Vp0v1'></tbody>
        <bdo id='Vp0v1'></bdo><ul id='Vp0v1'></ul>

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

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

                本文介绍了获取最顶层的 UIViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                如果我在 UINavigationController 上推送视图控制器和/或呈现模式视图控制器,我如何找出最顶部的 UIViewController 是什么?或者就我而言,我想知道某个 UITableViewController 是否是最顶层的.

                If I push view controllers and/or present modal view controllers on a UINavigationController, how can I find out what is the top most UIViewController? Or in my case, I want to know if a certain UITableViewController is the top most or not.

                我尝试使用:

                self.navigationController.topViewController == self
                

                ...但这不起作用.我猜它失败了,因为我在它上面展示了模态视图控制器,并且 topViewController 只跟踪在 UINavigationController 上推送了哪些视图(如反对那些以模态形式呈现的).

                ... but this doesn't work. I'm guessing that it's failing because I'm presenting modal view controllers on top of it and that the topViewController only keeps track of which views were pushed on the UINavigationController (as opposed to those that were presented modally).

                推荐答案

                你想要visibleViewController:

                当前可见的视图可以属于导航堆栈顶部的视图控制器,也可以属于模态显示的视图控制器.

                The currently visible view can belong either to the view controller at the top of the navigation stack or to a view controller that was presented modally.

                这篇关于获取最顶层的 UIViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:取消交互式 UINavigationController 弹出手势不会调用 UINavigationController 下一篇:将navigationBar背景图片设置为[UIImage new]后恢复

                相关文章

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

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

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

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