0
我有自定義註釋,它的calloutbubble具有視圖,其中表的高度爲200.
但是,在標註氣泡中設置它時,不會影響標註的大小泡沫
我該如何實現這一目標?
這裏是我的代碼
更改MapView中的CustomCallout氣泡高度 - iOS
-(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;
}
我已經試過這個。這是需要工作的。 –