Fork me on GitHub

MKMapView响应Touch事件

添加一个UITapGestureRecognizer; 然后:

tgr= [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(MapTouched:)];

[MapView addGestureRecognizer:tgr];

其中响应函数如下:

- (void)MapTouched:(UITapGestureRecognizer*)t
{
CGPointpt = [tlocationInView:MapView];
NSLog(@"%@",NSStringFromCGPoint(pt));
}




posted on 2012-03-01 15:18  pengyingh  阅读(319)  评论(0)    收藏  举报

导航