2012-09-27 31 views

回答

1

谢谢...我在做同样的,但它并没有为我工作...现在我正在通过使用UIButton而不是UIImageView来做到这一点。我附加处理器的按钮,设置button.backgroundImage,然后得到的图像在任何地方,我想...无论如何。 :)

0

这是我用在我的项目&它工作正常。

UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; 
    [self.view addGestureRecognizer:singleFingerTap]; 

- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer { 
    CGPoint location = [recognizer locationInView:[recognizer.view superview]]; 


    //Do stuff here... 
    // I assume that your imgview is imgView11 

    if (imgView11.frame.origin.x < location.x && location.x < something 
     && imgView11.frame.origin.y < location.y && location.y < something) { 

     largeImgView.image = imgView11.image; 
    } 
} 

如果你可以分享你的代码部件,那么我将编辑我的回答对HP解决您的问题