iphone uiwebview程序化缩放

编程入门 行业动态 更新时间:2024-10-27 13:24:18
本文介绍了iphone uiwebview程序化缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个应用程序,在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:

developer.apple/iphone/library/documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#jumpTo_26

,可以将动作发送到控件。

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程序化缩放

本文发布于:2023-11-26 19:55:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634966.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缩放   iphone   uiwebview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!