Uiscrollview embedded Uiwebview,uiwebview inside a ListBox

Source: Internet
Author: User
Tags tagname


There are multiple UIWebView in the Q:uiscrollview, the left and right slide will toggle UIWebView,

One of the UIWebView embedded in a CSS write Listbox,listbox in a number of pictures, left and right to slide the picture will switch.

How to distinguish these 2 kinds of sliding, in the listbox kind of sliding, do not let Uiscrollview also slide, in the other parts of webpage slide let Uiscroolview do switch.


A: By introducing gestureregnize to judge touch points, using JS to get the elements of UIWebView, here through the element name IMG and its source src to determine whether touch points fall in the ListBox, this is not a good way, but temporarily think of this method.

        NSString *js = [NSString stringwithformat:@ "Document.elementfrompoint (%f,%f). TagName", Pt.x, Pt.y];        NSString * TagName = [WebView stringbyevaluatingjavascriptfromstring:js];        NSLog (@ "tagname:%@", tagName);                       if ([TagName isequaltostring:@ "IMG"]) {            NSString *src = [NSString stringwithformat:@ "Document.elementfrompoint (%f ,%f). Src ", pt.x, Pt.y];            NSString * SrcName = [WebView stringbyevaluatingjavascriptfromstring:src];            NSLog (@ "srcname:%@", SrcName);        }

Enable or disable the scroll function of ScrollView by or not in the listbox





Uiscrollview embedded Uiwebview,uiwebview inside a ListBox

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.