重写视图的点击区域

@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 

posted @ 2014-02-10 17:34  leevaboo  Views(151)  Comments(0Edit  收藏  举报