Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

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

in the UIApplication class, that can send actions to controls.

Does anybody know how to send the double tap action programmatically to a UIWebView on a certain x,y?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
981 views
Welcome To Ask or Share your Answers For Others

1 Answer

get the UIWebview's subview which is a UIScrollview

UIScrollView *sview = [[webview subviews] objectAtIndex:0];

Then use zoom methods on that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...