Autozoom webview scrollview in Objective C

40 Views Asked by At

I want to autozoom my webview's scrollview from my code .

My desired output is enter image description here

But I am getting this enter image description here

I am sharing my code please help me out.

 webView.contentMode = UIViewContentModeScaleAspectFill | UIViewContentModeScaleAspectFit|UIViewContentModeScaleToFill
        ;
        webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
        webView.scalesPageToFit = YES;
        webView.autoresizesSubviews = YES;
        [webView stringByEvaluatingJavaScriptFromString:@"increaseMaxZoomFactor()"];
        [webView.scrollView zoomToRect:CGRectMake(300, 300, 300, 300) animated:YES];

Please help me out Thanks in advance

1

There are 1 best solutions below

0
Mahboob Nur On BEST ANSWER

Just this one line work the tricks for me

 webView.scalesPageToFit = NO;