search

Home  >  Q&A  >  body text

ios - 怎么解决手势冲突

我想在uiscrollView上面添加俩个手势,一个手势可以拖动uiscrollView上面tableView的cell,一个手势可以拖动tableView,但是在实际操作中,发现这俩个手势有冲突,且只能执行一个,请问这个问题怎么解决,给个大致思路就好,不甚感激

大家讲道理大家讲道理2771 days ago701

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-18 09:42:21

    Are the two gestures you mentioned different or the same? Your question is not specific, it is best to show the code so that you can see the problem.
    If there are two same gestures, there will be a problem, because they are both in the same window, and there can only be one responder after the event is passed in;
    If you just want to drag, you can use a long press gesture on one , one uses the tap gesture to distinguish events.
    If you don’t understand, ask me to write a demo for you

    reply
    0
  • Cancelreply