日期:2011.04.13转:http://stackoverflow.com/questions/3907397/gesuturerecognizer-on-uiimageviewCheck that userInteractionEnabled is YES on the UIImageView. Then you can add a gesture recognizer.imageView.userInteractionEnabled = YES;
UIPinchGestureRecognizer *pgr = [[UIPinchGestureRecognizer alloc]
initWithTarget:self action:@selector(handlePinch:)];
pgr.delegate = self;
[imageView addGestureRecognizer:pgr];
[pgr release];
:
:
- (void)handlePinch:(UIPinchGestureRecognizer *)pinchGestureRecognizer
{
//handle pinch...
}
+++++