!!! 多个手势怎么同时进行??
我在controller中添加了两个手势:
UIGestureRecognizer *recognizer; recognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(handleRotation:)]; recognizer.cancelsTouchesInView = NO; [self.scrollView addGestureRecognizer:recognizer]; [recognizer release]; UIGestureRecognizer *recognizer2; recognizer2 = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)]; recognizer2.cancelsTouchesInView = NO; [self.scrollView addGestureRecognizer:recognizer2]; [recognizer2 release];
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{ return YES;}