响应时间透过某个视图点击下面的视图:
在上层视图中加入下面的代码
///判断点的区域,在当前视图中的子视图有响应时间就返回响应视图,没有就返回nil,将手势传递到下层视图
///判断手势
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
if (CGRectContainsPoint(self.meunButton.frame, point)) {
return self.meunButton;
}else if (CGRectContainsPoint(self.homeButton.frame, point)){
return self.homeButton;
}else if (CGRectContainsPoint(self.currentLocation.frame, point)){
return self.currentLocation;
}else if (CGRectContainsPoint(self.organizationButton.frame, point)){
return self.organizationButton;
}else if (CGRectContainsPoint(self.activityButton.frame, point)){
return self.activityButton;
}else if (CGRectContainsPoint(self.positionButton.frame, point)){
return self.positionButton;
}else if (CGRectContainsPoint(self.workAddress.frame, point)){
return self.workAddress;
}
return nil;
}
网友评论