我有自定义注释,它的 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;
}