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

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

        <bdo id='FdCHr'></bdo><ul id='FdCHr'></ul>

      1. 如何使用 UISwipeGestureRecognizer 将“点击"传递给 UIView 下方的 UIBut

        时间:2023-07-30

          <tbody id='nfJ3u'></tbody>
        • <tfoot id='nfJ3u'></tfoot>
        • <small id='nfJ3u'></small><noframes id='nfJ3u'>

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

                  本文介绍了如何使用 UISwipeGestureRecognizer 将“点击"传递给 UIView 下方的 UIButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在(透明)UIView 下方有一个 UIButton.上面的 UIView 添加了一个 UISwipeGestureRecognizer ,这是它的唯一目的 - 检测某些滑动手势.我希望该 UIView 忽略所有其他触摸,并将其传递给其他视图(例如下面的 UIButton).目前,上面的 UIView 似乎正在检测点击(例如),什么都不做(应该是),并且不让下面的 UIButton 有机会响应.

                  I have a UIButton underneath a (transparent) UIView. The UIView above has a UISwipeGestureRecognizer added to it, and that is its only purpose - to detect certain swipe gestures. I want all other touches to be ignored by that UIView, and passed to other views (such as my UIButton underneath). Currently, the UIView above seems to be detecting the tap (for example), doing nothing (as it should be), and not letting the UIButton underneath get a chance to respond.

                  如果可能,我宁愿不实现自己的滑动识别器.任何解决方案/建议?我基本上只是想知道如何告诉 UIView 只关注某种类型的添加手势识别器,而忽略(从而让视图通过)所有其他触摸.

                  I would prefer not to implement my own swipe recognizer, if possible. Any solutions / advice? I basically just want to know how to tell a UIView to pay attention to only a certain type of added gesture recognizer, and ignore (and thus let through to views behind) all other touches.

                  推荐答案

                  我昨天一定是很生气——我今天醒来时发现了一个简单的解决方案.将 UISwipeGesture 添加到作为 UIView 和 UIButton 的超级视图的视图中.然后,在处理这些滑动时,找出滑动的来源,以及该点是否在我曾经拥有 UIView 的框架中.(正如我提到的,UIView 存在的唯一原因是为这些滑动手势定义一个目标区域.)

                  I must have just been in a funk yesterday - I woke up with a simple solution today. Add the UISwipeGesture to a view which is a superview to both the UIView and the UIButton. Then, when processing those swipes, figure out where the swipe originated, and whether that point is in the frame of where I used to have the UIView. (As I mentioned, the only reason for the existence of the UIView was to define a target area for these swipe gestures.)

                  这篇关于如何使用 UISwipeGestureRecognizer 将“点击"传递给 UIView 下方的 UIButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在iOS6上运行时UIButton背景颜色变为白色 下一篇:在 UITableViewController (Swift) 顶部添加按钮

                  相关文章

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

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

                    <tfoot id='IDZaH'></tfoot>