如何在UIWebview中识别用户touch
,tap
& double tap
。是否有像触摸开始等任何代表开始?UIWebview手势iOS
0
A
回答
4
这里是实现单轻叩和双击上的WebView
UITapGestureRecognizer *singleTap = [[[UITapGestureRecognizer alloc] initWithTarget: self action:@selector(doSingleTap)] autorelease];
singleTap.numberOfTapsRequired = 1;
[self.myWebView addGestureRecognizer:singleTap];
UITapGestureRecognizer *doubleTap = [[[UITapGestureRecognizer alloc] initWithTarget: self action:@selector(doDoubleTap)] autorelease];
doubleTap.numberOfTapsRequired = 2;
[self.myWebView addGestureRecognizer:doubleTap];
0
将下面的代码3个环节就能解决你的问题
how-to-add-a-gesture-recognizer-to-a-uiwebview-subclass
iphone-custom-gestures-on-your-uiwebview
does-uigesturerecognizer-work-on-a-uiwebview
关于抽头数,你可以将它通过属性numberOfTapsRequired
如:
UITapGestureRecognizer *myGusture = [[[UITapGestureRecognizer alloc] initWithTarget: self action:@selector(doTap)] autorelease];
myGusture.numberOfTapsRequired = 1; //you can change it to any number as per your requirement.
[self.myWebView addGestureRecognizer:myGusture];
[myGusture release];
myGusture = nil;
相关问题
- 1. iPhone - UIWebView手势
- 2. UIWebView和手势检测
- 3. UIWebView覆盖滑动手势
- 4. 通过UIWebView捕获手势
- 5. 滑动手势识别UIWebView
- 6. iOS - UITableView Pan手势
- 7. iOS - UILabels和手势
- 8. 滑动ios手势
- 9. iOS - 双击手势不能在UIWebView顶部工作
- 10. 如何在iOS的UIWebView上禁用长按手势
- 11. IOS 7 Safari历史记录拖动使用uiwebview的手势
- 12. 带自定义手势的UIWebView
- 13. 检测轻扫手势的UIWebView
- 14. 那里的长按手势UIWebView
- 15. 链接手势重新加载UIWebView
- 16. iPhone - 在UIPickerView和UIWebView上的手势
- 17. Xamarin.Forms - 如何实现手势识别器在iOS手势以外的手势?
- 18. cocos2d-iOS - 手势识别器
- 19. iOS - 忽略轻击手势
- 20. IOS:承认轻扫手势
- 21. MvvmCross绑定iOS手势
- 22. 自定义iOS手势
- 23. 的iOS:自来水手势
- 24. 关于ios点击手势
- 25. iOS上的手势过滤
- 26. iOS模拟单击手势
- 27. iOS按住手势+点击
- 28. 捏手势一个手指ios
- 29. 捏手势的手势绑定限制IOS
- 30. iOS捏手势与滑动手势冲突
如何才能辨别用户点击单个或两次。有代表吗? – Codesen 2012-07-30 09:52:55