iPhone UIWebView - How do you set the zoom level and position?

后端 未结 5 656
温柔的废话
温柔的废话 2021-01-12 01:33

I\'m displaying a series of tiled images in a UIWebView and would like to programmatically set the UIWebview\'s initial zoom and view location.

How does one go abo

5条回答
  •  孤独总比滥情好
    2021-01-12 02:01

    You can use this:

    for (UIView *subview in webView.subviews) {
        if ([subview isKindOfClass:[UIScrollView class]]) {
            ((UIScrollView *)subview).bounces = NO;
            [((UIScrollView *)subview) setZoomScale:10.5f animated:YES];
        }
    }
    

    It may be the solution to your problem.

提交回复
热议问题