iOS UIWebView add gestures

Source: Internet
Author: User

Blog: In the morning because of the rush to do the demo, there to use UIWebView load something, and then click WebView to jump, so he added a uiwebview, and then added a stand-alone gesture

UITapGestureRecognizer. Think there is no problem, wait until the test to find the click UIWebView No response.

Anatomy: UIWebView's head file point in to see, WebView on the Scrollview,scrollview itself is also a click event, in the setting of the agent of UITapGestureRecognizer can be seen, Can capture several gestures.

So in order to be able to respond to your own defined gestures, you should set them in your own proxy:

As follows

-(BOOL) Gesturerecognizer: (Uigesturerecognizer *) Gesturerecognizer Shouldrecognizesimultaneouslywithgesturerecognizer: (Uigesturerecognizer *) othergesturerecognizer{     if (Gesturerecognizer = = Self.tap)    {        return  YES;    }     return NO;}

If it is your own defined gesture response, if it is not your own defined gesture, it does not respond. = = There is no problem found, and so found, and then back to solve.

I think that more than 5 minutes to solve the matter is worth recording down.

iOS UIWebView add gestures

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.