问题描述
我正在开发一个应用程序,在iPhone文件系统上本地保存html文件,然后在UIWebView中加载它们。我希望能够在UIWebView上以编程方式缩放或双击,我尝试搜索javascript代码,但我只能滚动。
I'm developing an app that saves html files locally on iPhone file system, then load them in UIWebView. I want to be able to zoom or double tap programmatically on the UIWebView, I tried searching for javascript code, but I could only scroll.
我还尝试了webview转换,但没有为我工作。
我发现这个方法
I also tried the webview transform, but didn't work out for me.I found this method
sendAction:to:from:forEvent:
,可以将动作发送到控件。
in the UIApplication class, that can send actions to controls.
是否有人知道如何以编程方式将双击操作发送到UIWebView在某个x,y?
Does anybody know how to send the double tap action programmatically to a UIWebView on a certain x,y?
推荐答案
获取UIWebview的子视图,这是一个UIScrollview
get the UIWebview's subview which is a UIScrollview
UIScrollView *sview = [[webview subviews] objectAtIndex:0];
然后使用缩放方法。
这篇关于iphone uiwebview程序化缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!