How to turn off UIWebView horizontal bounce

How to turn off UIWebView horizontal bounce



for (id subview in webView.subviews
{
    if ( [[subview class] isSubclassOfClass:[UIScrollView class]] )
    {
        ((UIScrollView*) subview).bounces = NO;
        ((UIScrollView*) subview).alwaysBounceVertical = NO;
        ((UIScrollView*) subview).alwaysBounceHorizontal = NO;
        ((UIScrollView*) subview).bouncesZoom = NO;          
    }
}
NSString* scriptToPreventBouncing = @"<script type="text/javascript"> document.ontouchmove = function(e){ e.preventDefault(); } </script>";
NSString* footerHTML = @"<div>All rights reserved</div>";
[footer loadHTMLString: [scriptToPreventBouncing stringByAppendingString:footerHTML] baseURL:[NSURL URLWithString:@"http://somewebsite.com"]];
UIWebView *webView = [[UIWebView alloc] ....];
webView.scrollView.scrollEnabled = NO;
webView.scrollView.bounces = NO;


Learn More :