为什么UIWebView缩小图像? [英] Why does UIWebView shrink images?

查看:145
本文介绍了为什么UIWebView缩小图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用UIWebView在base64中显示图片( http:// www .abluestar.com / utilities / encode_base64 / index.php )。 UIWebView设置为Scales页面拟合,模式为左。图像可能是400px宽,但一旦在UiWebView中渲染,它甚至不占用屏幕的一半。我需要做一些像style =width:800px; ...,然后开始占据屏幕的大部分,是可读的(因为它不是这么小)。这是正确的方法吗?为什么图像在UIWebView中缩小,然后我必须拉伸它?

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?

推荐答案

这是要在我的html头中使用这个元标记

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;">

然后无需补偿缩放效果

这篇关于为什么UIWebView缩小图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆