答案 0 :(得分:0)
这就是我为我的项目所做的事情
委托方法
- (MKAnnotationView *) mapView:(MKMapView *)mapView1 viewForAnnotation:(id <MKAnnotation>) annotation
1)创建注释视图
MKAnnotationView *annView = [[MKAnnotationView alloc] initWithAnnotation:currentAnnotation reuseIdentifier:@"Cluster"];
2)设置框架和其他属性
[annView setFrame:CGRectMake(0, 0,100,100)]; //(Important)
annView.canShowCallout = YES;
[annView setCenterOffset:CGPointMake(0, -18)];
3)将图像视图添加为具有相同帧大小的子视图
UIImageView *homeImage = [[UIImageView alloc] initWithImage:[UIImage cachedImage:@"GroupPin"]];
[homeImage setFrame:CGRectMake(0, 0,100,100)]; //(Important)
[annView addSubview:homeImage];
return annView;
你已经完成了。