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

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

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

          <bdo id='nCOf9'></bdo><ul id='nCOf9'></ul>
      1. UINavigationItem 的持久 rightBarButtonItem 属性

        时间:2023-07-07

          • <bdo id='moHCq'></bdo><ul id='moHCq'></ul>
          • <legend id='moHCq'><style id='moHCq'><dir id='moHCq'><q id='moHCq'></q></dir></style></legend>
            1. <small id='moHCq'></small><noframes id='moHCq'>

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

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

                1. 本文介绍了UINavigationItem 的持久 rightBarButtonItem 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这可能是一个愚蠢的问题,但是否可以在 UINavigationController 管理的多个视图中保持正确的 UIBarButtonItem?我有一系列经常共享相同右侧 UIBarButtonItem 的视图,但是当我将新视图推送到我的 UINavigationController 时,我每次都必须重新定义按钮,即使它没有改变.大多数情况下,从一个视图到下一个视图的明显过渡动画让我感到困扰,因为完全相同的按钮会短暂地淡出然后又回来,这是不必要的,因为没有实际的视觉变化.我是否应该考虑只添加一个 UIButton 作为我的 UINavigationBar 的子视图并以这种方式完成右栏按钮"效果?

                  This may be a stupid question, but is it possible to keep a right UIBarButtonItem across multiple views managed by a UINavigationController? I have a progression of views that often share the same right UIBarButtonItem, but when I push a new view to my UINavigationController, I have to redefine the button every time, even if it hasn't changed. Mostly, the noticeable transitional animation from one view to the next is what bothers me because the exact same button briefly fades out then back in, which is unnecessary since there is no actual visual change. Should I consider just adding a UIButton as a subview of my UINavigationBar and accomplish a "right bar button" effect this way?

                  推荐答案

                  我们在我们的应用程序中做到了这一点.我们创建了一个 UIBarButtonItem,当用户导航时我们从一个 UIViewController 交换到另一个.诀窍是使用 UINavigationControllerDelegate、navigationController:willShowViewController:animated: 方法.我们将传出的 UIViewController 的 rightBarButtonItem 设置为 nil,将传入的控制器的 rightBarButtonItem 设置为您的按钮.管理起来很痛苦,但它确实有效.

                  We did this in our app. We created a single UIBarButtonItem that we swap from one UIViewController to another as the user navigates. The trick was to use UINavigationControllerDelegate, the navigationController:willShowViewController:animated: method. We set the outgoing UIViewController's rightBarButtonItem to nil and the incoming controller's rightBarButtonItem to your button. It's a pain to manage, but it works.

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

                  上一篇:UIButton 不允许 UIScrollView 滚动 下一篇:UIButton 不会变灰

                  相关文章

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

                    1. <legend id='BUmVc'><style id='BUmVc'><dir id='BUmVc'><q id='BUmVc'></q></dir></style></legend>
                      <tfoot id='BUmVc'></tfoot>
                    2. <small id='BUmVc'></small><noframes id='BUmVc'>

                      • <bdo id='BUmVc'></bdo><ul id='BUmVc'></ul>