【发布时间】:2013-11-01 01:20:14
【问题描述】:
更改 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);
}
【问题讨论】:
标签: ios objective-c uigesturerecognizer subview hittest