【发布时间】:2013-09-03 05:29:15
【问题描述】:
在我的应用程序中我在我的视图中添加了一个谷歌地图。
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];
}
但它仅适用于第一次触摸,从下一次触摸事件开始,此方法不会调用。
我不明白问题是什么
【问题讨论】:
-
我只尝试过这段代码,令人惊讶的是,每次我在任何时候触摸内部视图时它都会调用并完美记录值
-
是的,它适用于所有其他视图非常好.. 但是,在我当前的视图中没有谷歌地图视图
标签: iphone objective-c uitouch gmsmapview