简体   繁体   中英

uiwebview Zoom in Not working perfectly

I have zoom my webview using the following code on the button click event [webView_ stringByEvaluatingJavaScriptFromString:@"document.body.style.zoom = 5.0;"];

really the webview zoom when i am click that button after few second again webview comes normal state. Pls help me how to maintain that zoom without resize...

Thanks in advance, Suresh.M.

try to use this.

[webView_ setScalesPageToFit:YES];

This will help you.

Just add this to your html document head

<meta name='viewport' content='initial-scale=5.0'/>

Also, do

[webView_ setScalesPageToFit:YES]; 

as iPhoneiPadDev stated, if you want the webview to also allow zooming to different zoom level

cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM