当用户单击图钉(如 Zillow 应用程序)时,我正在显示自定义 UIView。现在的问题是我需要将视图放在实际引脚的正上方。MKAnnotationView 坐标系与地图相关。如何获取相对于 iPhone 屏幕的坐标,然后将视图放置在该坐标上。
- (void)mapView:(MKMapView *)mv didSelectAnnotationView:(MKAnnotationView *)view
{
// get view from storyboard
ZillowSearchResultAnnotation *annotation = (ZillowSearchResultAnnotation *) view.annotation;
PropertyAbstractViewController *propertyAbstractViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PropertyAbstractIdentifier"];
propertyAbstractViewController.view.frame = CGRectMake(0, 0, 100, 100);
[propertyAbstractViewController bind:annotation.data];
[mv addSubview:propertyAbstractViewController.view];
}