@interface UIFullTouchImageView : UIImageView
@end
@implementation UIFullTouchImageView
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
returnYES;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint p = [touch locationInView:self];
if (!CGRectContainsPoint(self.bounds, p)) {
self.hidden = YES;
}
}//继承UIImageView点击方法
@end