gpt4 book ai didi

ios - Pan 和 2 Finger Pinch 同时 iOS - 同时 -

转载 作者:可可西里 更新时间:2023-11-01 03:28:14 24 4
gpt4 key购买 nike

2 手势识别器:

UIPinchGestureRecognizer *twoFingerPinch = 
[[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
[croppper addGestureRecognizer:twoFingerPinch];

UIPanGestureRecognizer *PanRecognizer = [[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)] autorelease];
[croppper addGestureRecognizer:PanRecognizer];

和:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {        
return YES;
}

但是同时捏和平移是行不通的...我经常可以捏,因为平底锅识别器打开了。

问候

最佳答案

您似乎没有为每个手势识别器设置委托(delegate)。 gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: 是一个委托(delegate)方法,因此如果手势识别器没有委托(delegate),则不会调用此方法。

因此,默认返回值为NO,因此不会同时识别手势。

关于ios - Pan 和 2 Finger Pinch 同时 iOS - 同时 -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8403502/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com