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

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

问题描述

我使用一个UIWebView来显示以base64(图片 HTTP: //www.abluestar.com/utilities/en$c$c_base64/index.php )。该UIWebView中设置为缩放页面以适合的模式为左。该图像可能是400像素宽,但在UIWebView中一次呈现,它占用甚至没有屏幕的一半。我需要做类似的风格=宽度:800像素; ......这开始之前,占据了大部分屏幕并且是可读的(因为它不是那么小)。这是正确的方式?为什么图像缩小在一个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;">

那么就没有必要补偿缩放效果

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

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

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