【发布时间】:2016-07-28 05:54:07
【问题描述】:
我有自定义注释,它的 calloutbubble 具有高度为 200 的表格所在的视图。
但是,在标注气泡中设置它时,它不会影响标注气泡的大小
我怎样才能做到这一点?
这是我的代码
-(MKAnnotationView *)mapView:(MKMapView *)mapView1 viewForAnnotation:(id<MKAnnotation>)annotation
{
if([annotation isKindOfClass:[CustomAnnotation class]])
{
CustomAnnotation *location = (CustomAnnotation *)annotation;
MKAnnotationView *annotation_View = [mapView1 dequeueReusableAnnotationViewWithIdentifier:@"customAnnotation"];
if (annotation_View == nil)
{
annotation_View = location.annotationView;
if ([location.title isEqualToString:@"My Spot"])
{
annotation_View.image = [UIImage imageNamed:@"orange.png"];
}
else
{
annotation_View.image=[UIImage imageNamed:@"ocean.png"];
}
}
else
{
annotation_View.annotation = annotation;
}
[self configureDetailView:annotation_View];
return annotation_View;
}
return nil;
}
-(void)configureDetailView : (MKAnnotationView*)annotationView1
{
self.AnnotationViewForDetail.frame = CGRectMake(0, 0, 100, 200);
annotationView1.detailCalloutAccessoryView = self.AnnotationViewForDetail;
}
【问题讨论】:
标签: ios cllocationmanager mkannotation mkannotationview mapkitannotation