当我这样做时,我真的不确定为什么目标没有被调用:
UIImage * imgSrc = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageSource]]];
UIImageView * imgView = [[[UIImageView alloc] initWithImage:imgSrc] retain];
UIPinchGestureRecognizer * pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(resizeImage:)];
[imgView addGestureRecognizer:pinchGestureRecognizer];
[pinchGestureRecognizer release];
- (IBAction)resizeImage:(UIPinchGestureRecognizer *)sender
{
//not getting here
}未调用调整大小的图像。图像显示得很好
发布于 2012-01-13 05:02:08
您需要设置imgView.userInteractionEnabled = YES。它默认为"NO“。
https://stackoverflow.com/questions/8842177
复制相似问题