iphone - Disable UIWebView default scrolling behavior using objective-c -


I know that you can use javascript to do this

  & Lt; Script type = "text / javascript" & gt; TouchMove = Event (event) {event.preventDefault (); }  

What is the only way to use Objective-C?

Try it ...

  UIView * v = [ [Webview SubViews] Previous Object]; [V setScrollEnabled: NO]; [V bounce: no];  

Edit: Checks added in the original reply based on the comment below

  UIView * v = [[webView subviews ] LastObject]; If ([v iskindOfClass: [UIScrollView class]]) {if ([v respondsToSelector: @selector (setScrollEnabled)) {[set set: setcrollEnabled: NO];} ([v responds: teaser: @ selector (bounce)] ) [Bounce: No];}}  

Comments