如何在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. UIWebView覆蓋滑動手勢
- 2. 滑動手勢識別UIWebView
- 3. 通過UIWebView捕獲手勢
- 4. UIWebView和手勢檢測
- 5. iOS - UITableView Pan手勢
- 6. 如何在iOS的UIWebView上禁用長按手勢
- 7. 鏈接手勢重新加載UIWebView
- 8. 帶自定義手勢的UIWebView
- 9. iPhone - 在UIPickerView和UIWebView上的手勢
- 10. iOS - 忽略輕擊手勢
- 11. 自定義iOS手勢
- 12. cocos2d-iOS - 手勢識別器
- 13. iOS按住手勢+點擊
- 14. iOS上的手勢過濾
- 15. 捏手勢一個手指ios
- 16. 在iPhone中管理手勢IOS 3.1.2
- 17. 與對象IOS滑動手勢
- 18. 離子角手勢捏崩潰ios
- 19. iOS多任務手勢 - 禁用/啓用
- 20. 手勢衝突UITableView滑動刪除iOS
- 21. IOS:雙擊自我的一半手勢
- 22. 的iOS:右輕掃手勢在UIPageViewController
- 23. Xamarin表單地圖點擊手勢IOS
- 24. iOS:在子視圖內輕掃手勢
- 25. 搖動手勢不工作iOS
- 26. ios圖像上的文字手勢
- 27. 在Flash CS6中iOS的滑動手勢
- 28. 禁用手勢識別器iOS
- 29. iOS手勢識別和處理
- 30. 檢測搖動手勢iOS Swift
如何才能辨別用戶點擊單個或兩次。有代表嗎? – Codesen 2012-07-30 09:52:55