禁用UIWebView中的缩放,但保持其他用户交互 [英] Disable zoom in a UIWebView but keep other user interaction

查看:79
本文介绍了禁用UIWebView中的缩放,但保持其他用户交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示一些文本的UIWebView,我想禁用缩放/取消缩放,但我想检测用户何时点击链接。我已尝试禁用MultiTouch但缩放仍在工作。

I have a UIWebView that shows some text, I want to disable zoom/unzoom but I want to detect when users tap on a link. I have tried with disabling MultiTouch but zoom is still working.

推荐答案

将webview的UIScrollView上的minimumZoomScale和maximumZoomScale设置为1.0应该阻止webview缩放。

Setting the minimumZoomScale and maximumZoomScale on your webview's UIScrollView to be 1.0 should prevent the webview from zooming.

webview.scrollView.maximumZoomScale = 1.0;
webview.scrollView.minimumZoomScale = 1.0;

这篇关于禁用UIWebView中的缩放,但保持其他用户交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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