A simple problem, I have a webview that should only contain an image so that the user can zoom in and out. To make my view look clean, I want to completely disable bouncing on this view, but still allow scrolling. This solution really works for vertical bounce, but as soon as I enlarge the image to a size larger than the screen, horizontal bounce is still possible:
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;
}
}
Dan f source
share