UIWebView的缩放范围非常有限 [英] UIWebView's zoom range is very limited

查看:67
本文介绍了UIWebView的缩放范围非常有限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试UIWebView.我向其中加载了少量的自定义HTML.没什么特别的-两页,一小段文字和一页上的一幅小图像.我正在用它来测试课程.

I have a test UIWebView. I loaded a small amount of custom HTML into it. Nothing special -- two pages, a little text, and a small image on one of the pages. I am using it to test out the class.

我遇到的一个问题是放大和缩小的能力非常有限.看来,即使我设置了UIWebView的UIScrollView的minimumZoomScale和maximumZoomScale属性,某些操作也会将它们重置为1.5或更小的比例.而且,如果我尝试经常设置它们,则该应用程序会非常不高兴,并且很容易崩溃.

One problem I am having is that my ability to zoom in and out is very limited. It seems that even if I set the minimumZoomScale and maximumZoomScale properties of the UIWebView's UIScrollView, something resets them to a factor of 1.5 or smaller ratio. And if I try to set them often, the app gets very unhappy and is prone to crash.

任何人都可以解释发生了什么事吗?

Can anyone explain what is going on?

推荐答案

您需要将以下行放入HTML文档的head部分.

You need to put the following line in the head section of your HTML document.

<meta name="viewport" content="user-scalable=yes,maximum-scale=5.0,minimum-scale=0.25" />

有关此文档: http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html

这篇关于UIWebView的缩放范围非常有限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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