<bdo id='DtQta'></bdo><ul id='DtQta'></ul>
  • <small id='DtQta'></small><noframes id='DtQta'>

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

      1. <legend id='DtQta'><style id='DtQta'><dir id='DtQta'><q id='DtQta'></q></dir></style></legend>
        <tfoot id='DtQta'></tfoot>
      2. navigationController.navigationItem 与 navigationItem

        时间:2023-05-17

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

            <tfoot id='piXAM'></tfoot>
            <i id='piXAM'><tr id='piXAM'><dt id='piXAM'><q id='piXAM'><span id='piXAM'><b id='piXAM'><form id='piXAM'><ins id='piXAM'></ins><ul id='piXAM'></ul><sub id='piXAM'></sub></form><legend id='piXAM'></legend><bdo id='piXAM'><pre id='piXAM'><center id='piXAM'></center></pre></bdo></b><th id='piXAM'></th></span></q></dt></tr></i><div id='piXAM'><tfoot id='piXAM'></tfoot><dl id='piXAM'><fieldset id='piXAM'></fieldset></dl></div>
              <tbody id='piXAM'></tbody>
              <legend id='piXAM'><style id='piXAM'><dir id='piXAM'><q id='piXAM'></q></dir></style></legend>
                • <bdo id='piXAM'></bdo><ul id='piXAM'></ul>
                • 本文介绍了navigationController.navigationItem 与 navigationItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  只是好奇,为什么设置 self.navigationItem = ... 有效,但 self.navigationController.navigationItem 失败?这同样适用于 self.toolbarItemsself.navigationController.toobarItems.

                  Just curious, why setting self.navigationItem = ... works, but self.navigationController.navigationItem fails? The same applies for self.toolbarItems vs self.navigationController.toobarItems.

                  什么时候使用self.navigationController.navigationItem?

                  也许你会说,它们指向不同的东西.但是为什么 self.navigationController.navigationBarHidden = YES 导航栏是隐藏的.不是说 self.navigationController.navigationItem 指向我想要的栏吗?

                  Maybe you will say, they point to different things. but why self.navigationController.navigationBarHidden = YES the navigation bar is hidden. doesn't it means self.navigationController.navigationItem point to the bar i wanted?

                  推荐答案

                  UIViewController有一个属性navigationItem.

                  无论是 UICollectionViewControllerUITableViewControllerUINavigationViewController 还是任何自定义子类,所有子类也是如此.

                  This is true of all the subclasses too whether it is a UICollectionViewController, UITableViewController, UINavigationViewController or any custom subclass.

                  当由 UINavigationController 呈现时,导航控制器将创建此属性,因此每个视图控制器都有自己的 navigationItem.如果您不从导航控制器中显示它,则 navigationItem 为 nil.

                  When presented by a UINavigationController the nav controller will create this property and so each view controller gets its own navigationItem. If you do not present it from a navigation controller then the navigationItem is nil.

                  现在,使用 UINavigationController 您很有可能将其用作您的初始视图控制器.因此,导航控制器没有被另一个导航控制器呈现,并且它的 navigationItem 属性为 nil.

                  Now, with a UINavigationController you are more than likely using this as your initial view controller. Therefore, the navigation controller is NOT being presented by another navigation controller and its navigationItem property is nil.

                  导航栏略有不同,因为这是以相反的方式管理的.

                  The navigation bar is slightly different as this is managed the other way around.

                  这篇关于navigationController.navigationItem 与 navigationItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:单击 UIWebView 中的链接会推送到 NavigationView 堆栈 下一篇:“已加载笔尖,但未设置视图出口"例外

                  相关文章

                    <bdo id='7dVJx'></bdo><ul id='7dVJx'></ul>

                  <small id='7dVJx'></small><noframes id='7dVJx'>

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

                  1. <tfoot id='7dVJx'></tfoot>
                  2. <legend id='7dVJx'><style id='7dVJx'><dir id='7dVJx'><q id='7dVJx'></q></dir></style></legend>