更改 uiview 位置(y = -50)后,单击不适合我添加的子视图的位置。Hittest 表示 touchview 从 -50 开始,而不是 0。如何解决这个问题?
myview = [[UIScrollView alloc] initWithFrame:CGRectMake(0, -50, mywidth, myheight)];
单击:
// SINGLE TAP
- (void)singleTapRecognized:(UIGestureRecognizer *)gestureRecognizer {
CGPoint touchPoint = [gestureRecognizer locationInView:self.view];
UIView *touchView = [myview hitTest:touchPoint withEvent:nil];
NSLog(@"Y touchPoint: %f",touchPoint.y);
NSLog(@"Y touchView: %f",touchView.frame.origin.y);
}