注释引脚颜色没有变化,详细信息披露不在Mapkit中

时间:2011-05-26 09:17:42

标签: iphone objective-c

- (MKPinAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id) annotation{

 MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"MyPin"];
    annView.enabled=YES;    
    [annView setCanShowCallout:NO];
    annView.pinColor=MKPinAnnotationColorGreen;
    UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    //[rightButton addTarget:self action:@selector(annotationViewClick:) forControlEvents:UIControlEventTouchUpInside];
    annView.rightCalloutAccessoryView = rightButton;
    return annView;

}

我只使用这个代码但是没有工作.....帮助我! 提前谢谢......

1 个答案:

答案 0 :(得分:0)

通过设置[annView setCanShowCallout:NO];,无法显示注释的标注。细节披露将在标注中显示。