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];
Found that you can only enter Pinch gestures, can not enter Rotation gestures. If you add only one, is you can perform.
I added
in the Controller
- (BOOL) gestureRecognizer: (UIGestureRecognizer *) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer *) otherGestureRecognizer
{
return YES;
}
But found not executed. Then add in the scrollView the same code. Although the execution, but the effect is still the same. Pinch and Rotation of these two gestures have not performed simultaneously. No execution is executed only after Rotation
PinchIs this why? How to let two gestures while performing?
Reply:
Find a reason, to give the gesture set delegate, namely:
recognizer.delegate = self;
recognizer2.delegate = self;
Who will pick points? ?
Reply:
Then I'll pick it
But why do you want to overwrite the gesture
Reply:
Gesture cover? ?
I need to scale the image can be rotated simultaneously, which requires different gestures to achieve it?
Wait Results posted, and nothing else of it all to you, ha ha
Reply:
I also used the landlord that the proxy method is a UILongPressGestureRecognizer and a UIPanGestureRecognizer also set delegate = self proxy approach also wrote the returns YES; but still only respond UIPanGestureRecognizer way to ask this is why
No comments:
Post a Comment