开发者

uiwebview Zoom in Not working perfectly

开发者 https://www.devze.com 2023-04-02 10:20 出处:网络
I have zoom my webview using the following code on the button click event [webView_ stringByEvaluatingJavaScriptFromString:@\"document.body.style.zoom = 5.0;\"];

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 开发者_Python百科webview comes normal state. Pls help me how to maintain that zoom without resize...

Thanks in advance, Suresh.M.


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


try to use this.

[webView_ setScalesPageToFit:YES];

This will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消