Gesture recognizers and Touch event distribution

Source: Internet
Author: User

Problem description
在iOS7下开发,真机调试时,UIButton的其他事件响应都正常,但是UIControlEventTouchDown事件响应会延迟,而且不同响应区域发生的延时情况不同,有时延迟1s以后响应TouchDown事件,有时候一直按着不动就不响应事件,只有把手指轻轻滑动下才能正常响应TouchDown事件。
Problem analysis
UIControlEventTouchDown事件是一旦手指碰到按钮就调用了,这样在iOS7上会产生一个冲突,由于iOS7加上了手势滑动返回这么一个动作,在手势滑动返回时那个区域是不允许有UIControlEventTouchDown事件的,不然就会有事件冲突了,系统不知道是要准备返回还是要点击那个Button,所以就加上了TouchDown事件的一个延迟响应。
Solution Solutions
    • Disables all swipe-back gestures, allowing touchdown to respond normally
      self.navigationController.interactivePopGestureRecognizer.delaysTouchesBegan=NO;

Gesture recognizers and Touch event distribution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.