模拟触摸iphone [英] Simulate touch on iphone
问题描述
我试图模拟UIWebView的触摸,如何以编程方式在特定位置触发触摸事件? (x和y坐标)
只需调用touchesBegan?
Im trying to simulate a touch on as UIWebView, how can I programmatically fire a touch event at a certain location? (x and y coordinates) Just call touchesBegan?
理想情况下,我想做的没有任何javascript黑客,因为在将来可能不是一个uiwebview
Ideally I'd like to do it without any javascript hack because in the future it may not be a uiwebview
推荐答案
在iPhone上合成触摸事件并不容易:您必须使用未公开的API,因此您有一个高在iOS的每一次更新中被破坏并得到苹果拒绝的概率。
It's not easy to synthesize a touch event on the iPhone: you have to use undisclosed API, so you have a high probability of breaking on every update of the iOS and getting rejecting from Apple.
这是一个链接,演示如何在iPhone上综合触摸事件:
Here's a link that demonstrates how to synthesize a touch event on the iPhone:
这是StackOverflow的另一个问题:如何向iPhone发送触摸事件OS?
Here's another question on StackOverflow: How to send a touch event to iPhone OS?
这篇关于模拟触摸iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!