<tfoot id='kUQAe'></tfoot>
  • <legend id='kUQAe'><style id='kUQAe'><dir id='kUQAe'><q id='kUQAe'></q></dir></style></legend>
    • <bdo id='kUQAe'></bdo><ul id='kUQAe'></ul>
  • <small id='kUQAe'></small><noframes id='kUQAe'>

    1. <i id='kUQAe'><tr id='kUQAe'><dt id='kUQAe'><q id='kUQAe'><span id='kUQAe'><b id='kUQAe'><form id='kUQAe'><ins id='kUQAe'></ins><ul id='kUQAe'></ul><sub id='kUQAe'></sub></form><legend id='kUQAe'></legend><bdo id='kUQAe'><pre id='kUQAe'><center id='kUQAe'></center></pre></bdo></b><th id='kUQAe'></th></span></q></dt></tr></i><div id='kUQAe'><tfoot id='kUQAe'></tfoot><dl id='kUQAe'><fieldset id='kUQAe'></fieldset></dl></div>
      1. UINavigationController 上的确认返回按钮

        时间:2023-06-12

            <tbody id='m0OEP'></tbody>

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

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

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

                  问题描述

                  我正在为使用 UINavigationController 的应用程序使用 storyboard.我想在默认的后退按钮中添加一个确认对话框,这样用户就不会意外注销.有没有办法做到这一点?我发现当 UINavigationController 自动创建后退按钮时,我不能简单地访问它.

                  I am using the storyboard for my app which is using UINavigationController. I would like to add a confirmation dialog to the default back button so the user does not log out accidentally. Is there some way to do this? I have found that I cannot simply access the back button when it has be automatically created by the UINavigationController.

                  有什么想法吗?

                  推荐答案

                  很遗憾,这种方式无法拦截后退按钮.最接近的传真是使用您自己的 UIBarButtonItem 设置为 navigationItem.leftBarButtonItem 并设置一个动作来显示您的警报等.我有一个图形设计师创建看起来像的按钮图像标准的后退按钮.

                  Unfortunately, you can't intercept the back button in this way. The closest facsimile is to use your own UIBarButtonItem set to the navigationItem.leftBarButtonItem and set an action to display your alert etc. I had a graphic designer create button images that look like the standard back button.

                  顺便说一句,出于不同的原因,我需要拦截后退按钮.我敦促您重新考虑这种设计选择.如果您正在呈现用户可以进行更改的视图,并且您希望他们可以选择保存或取消恕我直言,最好使用保存"和取消"按钮而不是带有警报的后退按钮.警报通常很烦人.或者,明确说明您的用户所做的更改是在他们进行更改时提交的.那么这个问题就没有实际意义了.

                  As an aside, I needed to intercept the back button for a different reason. I urge you to reconsider this design choice. If you are presenting a view where users can make changes and you want them to have the choice to save or cancel IMHO it's better to use 'Save' and 'Cancel' buttons vs a back button with an alert. Alerts are generally annoying. Alternatively, make it clear that the changes your users are making are committed at the time they make them. Then the issue is moot.

                  这篇关于UINavigationController 上的确认返回按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iPhone:UINavigationController 顶部的奇怪空间 下一篇:不断收到“对 &lt;ViewController&gt; 的开始/结束外观转换的不平衡调用"

                  相关文章

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

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

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

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