UIWebView 不接受多次触摸
为了在我为应用程序开发的消息传递系统上显示附件,我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否有可能将
scalesPageToFit
设置为NO
?这可能会导致与您所看到的类似的行为。Is it possible that
scalesPageToFit
is set toNO
? That might cause similar behavior to what you are seeing.