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 about doing so?
Set attribute scalesPageToFit of UIWebView to YES. Then the webpage is scaled to fit and the user can zoom in and zoom out.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With