当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - setExclusiveTouch ignored when using UISwipeGestureRecognizer

问题描述:

I have two UIViews (custom scroll views) that respond to UISwipeGestureRecognizer. These two UIViews are subviews of the parent UIView. I want to allow only one of the subviews to respond to the recognizer.

In other words, only one should be allowed to be swiped at a time.

Setting setExclusiveTouch = YES on the subviews AND/OR the parent view doesn't have any effect.

How can I make sure that only 1 subview is being swiped at a time?

Here's a picture:

网友答案:

UIScrollView's by default have multipleTouchEnabled set to YES - if you do not need multiple touch (zooming for example requires it), then set it to NO.

分享给朋友:
您可能感兴趣的文章:
随机阅读: