iphone uiwebview programmatic zoom(iphone uiwebview 程序化缩放)
问题描述
我正在开发一个应用程序,它将 html 文件本地保存在 iPhone 文件系统上,然后在 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:
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#jumpTo_26
在 UIApplication 类中,可以向控件发送操作.
in the UIApplication class, that can send actions to controls.
有人知道如何以编程方式将双击动作发送到某个 x,y 上的 UIWebView 吗?
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 程序化缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iphone uiwebview 程序化缩放


基础教程推荐
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01