So I have looked over a bunch of other questions that could possible be duplicates. But none of the solutions that have been mentioned seem to work. Also, the answers tend to be scattered and incomplete.

So, I have a UIView inside of a subclassed UIScrollView. All I need to do is have the UIScrollview ignore all forms of gesture that can occur with 3 fingers and, instead, pass it on to the UIView inside. Could someone help me with this.

有帮助吗?

解决方案

You need to subclass the scrollview to accomplish this. I tested this technique with a UITableView just now and it worked.

@interface OneTwoTouchScrollView : UIScrollView
@end

@implementation OneTwoTouchScrollView

-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)recognizer
{
    return recognizer.numberOfTouches < 3 && [super gestureRecognizerShouldBegin:recognizer];
}

@end
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top