开发者

Annotation pin color not changing and the detail disclosure is not coming in the Mapkit

开发者 https://www.devze.com 2023-03-08 07:15 出处:网络
- (MKPinAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id) annotation{ MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@\"M
- (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;

}

I m using this code only but ts not woking.....Help m开发者_StackOverflow中文版e!!! Thanks in advance......


By setting [annView setCanShowCallout:NO]; the call-out for the annotation cannot be displayed. And the detail disclosure will be visible in the callout.

0

精彩评论

暂无评论...
验证码 换一张
取 消