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