質問

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