通过点击放大 uiwebview?
在 Safair mobile 中,如果您显示的是 html 页面,则可以通过双击来放大。 但是,如果您使用 uiwebview 并显示图像或 pdf 文件,则必须张开手指才能缩放。
我的问题是:在 uiwebview 中显示图像或 pdf 文件时,我需要做什么才能让双击工作?
您可以将 uiwebview 设置为 uiscrollview 下的子视图吗,然后您可以双击缩放吗? 你会怎么做?
In Safair mobile you can zoom in by double taping if you have a html page that you display.
But if you use a uiwebview and display an image or pdf file you have to pinch open to zoom.
My question is: what do I have to do to get double tap to work when displaying an image or pdf file i a uiwebview?
Can you make the uiwebview a sub view under a uiscrollview, will you then be able to double tap an zoom?
And how would you do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Mobile Safari 中双击的真正作用是聚焦内容。它将找到您点击的网页上的
div
或部分,然后缩放至焦点。它不仅仅是“双击缩放”。What a double tap in Mobile Safari really does is focus on the content. It will find the
div
or section on the web page that you tapped on and then zoom to focus. It is not simply 'double tap to zoom'.要从 UIWebview 获得双击,您需要子类化 UIWindow 并使用该方法,
To get double tap from UIWebview u need to subclass the UIWindow and use the method,