Stop UIWebView from “bouncing” vertically?

for (id subview in webView.subviews)
  if ([[subview class] isSubclassOfClass: [UIScrollView class]])
    ((UIScrollView *)subview).bounces = NO;

…seems to work fine.

It’ll be accepted to App Store as well.

Update: in iOS 5.x+ there’s an easier way – UIWebView has scrollView property, so your code can look like this:

webView.scrollView.bounces = NO;

Same goes for WKWebView.

Leave a Comment