我已經在我的應用中實現了所有手勢,並在shouldRecognizeSimultaneouslyWithGestureRecognizer
中返回YES。 我面臨的問題是當我平移一點,它認爲它是一個singleTap
和代碼爲singleTap
正在執行。我可以理解,我必須在shouldRecognizeSimultaneouslyWithGestureRecognizer
中做條件代碼,但是我得到的兩個手勢是rotationGesture
和panGesture
? 我卡住了。任何幫助將不勝感激。小panGesture採取singleTap手勢,爲什麼? iOS
1
A
回答
0
我解決了它自己,
對於其他人誰正面臨這樣的困難,
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if ([otherGestureRecognizer isKindOfClass:[singleTapGesture class]] || [otherGestureRecognizer isKindOfClass:[panGesture class]]) {
return NO;
} else {
return YES;
}
}
0
對於貼帶,縮放有多個第三方視圖可用,您可以使用它們,因爲它們已經過測試。我更喜歡ZDStickerView的大部分應用程序link。
相關問題
- 1. 實現手勢檢測器拖動,DoubleTap和singleTap一個ImageView
- 2. UIWebview手勢iOS
- 3. 採用Android的手勢
- 4. iOS項目:爲什麼長按手勢很容易被觸發?
- 5. 爲什麼我的WinJS手勢不火?
- 6. iOS - UITableView Pan手勢
- 7. iOS - UILabels和手勢
- 8. 滑動ios手勢
- 9. 爲什麼EKEventEditViewController採取〜3秒加載
- 10. 爲什麼我不能從數組中獲取手勢狀態
- 11. Windows手勢識別器內置的手勢指標是什麼?
- 12. SWRevealViewController panGesture問題 - IOS/Swift
- 13. Xamarin.Forms - 如何實現手勢識別器在iOS手勢以外的手勢?
- 14. cocos2d-iOS - 手勢識別器
- 15. iOS - 忽略輕擊手勢
- 16. IOS:承認輕掃手勢
- 17. MvvmCross綁定iOS手勢
- 18. 自定義iOS手勢
- 19. 的iOS:自來水手勢
- 20. 關於ios點擊手勢
- 21. iOS上的手勢過濾
- 22. iOS模擬單擊手勢
- 23. iOS按住手勢+點擊
- 24. 在iOS 7中,superview的手勢應該取消子視圖的手勢嗎?
- 25. 爲什麼不採取行動註冊?
- 26. 爲什麼CSS規則採取precendence
- 27. 爲什麼 - >不採取(FN)?
- 28. 爲什麼TR不採取風格?
- 29. 捏手勢一個手指ios
- 30. 什麼是android中的手勢?
你能不能請在這裏發表代碼片段? –