是否可以在 MKMapPoint 中添加 uiview,我尝试过的代码如下所示,但它不起作用。任何帮助表示赞赏。
-(IBAction)foundTap:(UITapGestureRecognizer *)recognizer
{
CGPoint point = [recognizer locationInView:self.myMapView];
CLLocationCoordinate2D tapPoint = [self.myMapView convertPoint:point toCoordinateFromView:self.view];
MKMapPoint myMapPoint = MKMapPointForCoordinate(tapPoint);
UIView *mymapview=[[UIView alloc]initWithFrame:CGRectMake(myMapPoint.x, myMapPoint.y, 20, 20)];
mymapview.backgroundColor=[UIColor greenColor];
[self.view addSubview:mymapview];
}
谢谢。