hitAreaPadding 是传入的size 可以定义为属性
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)
event
{
if (self.hidden || self.alpha ==
0 || self.userInteractionEnabled == NO || self.enabled ==
NO) {
return NO;
}
CGRect bounds =
self.bounds;
bounds = CGRectInset(bounds, -self.hitAreaPadding.width, -
self.hitAreaPadding.height);
return CGRectContainsPoint(bounds, point);
}
转载于:https://www.cnblogs.com/KingQiangzi/p/9883274.html