UIWebView 不接受多次触摸

发布于 2024-09-29 02:52:00 字数 634 浏览 1 评论 0原文

为了在我为应用程序开发的消息传递系统上显示附件,我有一个 UIWebView,它显示在 ModalViewController 中,显示附件中包含的文件。

如果有任何帮助,我用来显示文件的代码如下:

NSUrl docUrl = NSUrl.FromFilename(filePath);
NSUrlRequest request = new NSUrlRequest(docUrl);
webView.LoadRequest(request);

(filePath 是文件路径的字符串)。

这对于显示 PDF、文本文档等非常有用。

但是,UIWebView 不接受任何多点触摸手势(捏合缩放等) - 我已经设置了

webView.MultipleTouchEnabled = true;
webView.UserInteractionEnabled = true;

但仍然没有运气。我必须使用 GestureRecognizer 还是我遗漏了一些明显的东西?

我知道我正在使用 Monotouch,但 Objective C 的答案非常受欢迎:)

To display attachments on a messaging system I'm developing for my app, I've got a UIWebView which is presented in a ModalViewController, displaying the file contained in the attachment.

If it's any help, the code I'm using to display the file is as follows:

NSUrl docUrl = NSUrl.FromFilename(filePath);
NSUrlRequest request = new NSUrlRequest(docUrl);
webView.LoadRequest(request);

(filePath is a string of the Path to the file).

This works fantastic for displaying PDFs, text documents etc.

However, the UIWebView isn't accepting any multi touch gestures (pinch to zoom etc) - I've set

webView.MultipleTouchEnabled = true;
webView.UserInteractionEnabled = true;

yet still no luck. Will I have to use a GestureRecognizer or am I missing something obvious?

I'm aware I'm using Monotouch but Objective C answers are more than welcome : )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉栀 2024-10-06 02:52:00

是否有可能将 scalesPageToFit 设置为 NO?这可能会导致与您所看到的类似的行为。

Is it possible that scalesPageToFit is set to NO? That might cause similar behavior to what you are seeing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文