在我的应用程序中,我在视图中添加了谷歌地图。
I want to know the touch point on the mapView / myView,
我在哪里录的
所以我实现了如下逻辑。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint touchPoint = [[touches anyObject] locationInView:mapView_];
CGPoint touchPoint2 = [[touches anyObject] locationInView:self.view];
NSLog(@"========== %@", NSStringFromCGPoint(touchPoint));
NSLog(@"========== %@", NSStringFromCGPoint(touchPoint2));
//UITouch *touch = [[event allTouches] anyObject];
//CGPoint touchPoint = [touch locationInView:touch.view];
}
但它仅适用于第一次触摸,从下一次触摸事件开始,此方法不会调用。
我没明白问题是什么