//重寫(xiě)該方法后可以讓超出父視圖范圍的子視圖響應(yīng)事件
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
????????UIView *view = [super hitTest:point withEvent:event];
????????if (view == nil) {
????????????????for (UIView *subView in self.subviews) {
????????????????????????CGPoint tp = [subView convertPoint:point fromView:self];
? ? ? ? ? ? ? ? ? ? ? ? if (CGRectContainsPoint(subView.bounds, tp)) {
? ? ? ? ? ????????????????????????view = subView;
? ? ? ? ? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ? ?}
? ? ? ? ?}
? ? ? ? return view;
}