Why does UIWebView shrink images?

爷,独闯天下 提交于 2020-01-01 18:16:12

问题


I'm using a UIWebView to display images in base64 (http://www.abluestar.com/utilities/encode_base64/index.php). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and I have to then stretch it?


回答1:


The best way I've found to counter this is to use this meta tag in my html head

<meta name="viewport" content="width=320;height=420;user-scalable=yes;initial-scale=1.0;">

Then there's no need to compensate for the scaling effect



来源:https://stackoverflow.com/questions/835040/why-does-uiwebview-shrink-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!