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

      <tfoot id='ABxcy'></tfoot>

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

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

      2. 在 Swift 中禁用向后滑动手势

        时间:2023-05-17
        <i id='pDayp'><tr id='pDayp'><dt id='pDayp'><q id='pDayp'><span id='pDayp'><b id='pDayp'><form id='pDayp'><ins id='pDayp'></ins><ul id='pDayp'></ul><sub id='pDayp'></sub></form><legend id='pDayp'></legend><bdo id='pDayp'><pre id='pDayp'><center id='pDayp'></center></pre></bdo></b><th id='pDayp'></th></span></q></dt></tr></i><div id='pDayp'><tfoot id='pDayp'></tfoot><dl id='pDayp'><fieldset id='pDayp'></fieldset></dl></div>

          <tbody id='pDayp'></tbody>
            <bdo id='pDayp'></bdo><ul id='pDayp'></ul>

                <tfoot id='pDayp'></tfoot>

                • <small id='pDayp'></small><noframes id='pDayp'>

                  <legend id='pDayp'><style id='pDayp'><dir id='pDayp'><q id='pDayp'></q></dir></style></legend>
                  本文介绍了在 Swift 中禁用向后滑动手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  在这里找了一段时间,但似乎找不到有效的解决方案.

                  Been looking around on here for a while but can't seem to find a working solution.

                  我正在尝试在 Swift 中禁用滑动以返回上一个视图手势.

                  I'm trying to disable the swipe to go back to previous view gesture, in Swift.

                  我尝试了多种解决方案,包括:

                  I've tried a variety of solutions including:

                  self.navigationController?.interactivePopGestureRecognizer.enabled = false
                  

                  self.navigationController.interactivePopGestureRecognizer.delegate = self
                  
                  func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer!) -> Bool {
                      return false
                  }
                  

                  有没有一种新方法可以做到这一点或其他一些有效的方法?

                  Is there a new method of doing this or some other method that works?

                  推荐答案

                  您可以禁用它,但不建议这样做,因为大多数 iOS 用户通过滑动返回而不是按返回按钮.如果你想禁用它,使用 modal segue 代替推送 segue 会更合理,因为推送的转移不是那么大.如果你真的想摆脱滑动返回功能,我会禁用返回按钮并在屏幕右上角有一个完成按钮.

                  You could disable it but that would not be to recommended as most iOS users go back by swiping and less by pressing the back button. If you want to disable it it would be more reasonable to use a modal segue instead of a push segue which is not that big of a transfer. If you really want to get rid of the swipe to go back function I would just disable the back button and have a done button on the top right of the screen.

                  self.navigationController?.navigationItem.backBarButtonItem?.isEnabled = false;
                  

                  这篇关于在 Swift 中禁用向后滑动手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iPhone UINavigation 问题 - 嵌套推送动画可能导致导航栏损坏 下一篇:更改 UINavigationBar 背景图像

                  相关文章

                  <small id='1TKIG'></small><noframes id='1TKIG'>

                • <legend id='1TKIG'><style id='1TKIG'><dir id='1TKIG'><q id='1TKIG'></q></dir></style></legend>

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