1

Hi am trying to change the annotation detail view(show in map image) into a custom design like the second image.

How can i change that background image and all?

my current code is

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

    mapView.showsUserLocation = YES;
    if([annotation isKindOfClass:[MKUserLocation class]])
        return nil;


    static NSString *identifier = @"myAnnotation";
    MKPinAnnotationView * annotationView = (MKPinAnnotationView*)[_MAPVIEW dequeueReusableAnnotationViewWithIdentifier:identifier];
    if (!annotationView)
    {

        annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
        annotationView.pinColor = MKPinAnnotationColorPurple;

        annotationView.canShowCallout = YES;
    }else {
        annotationView.annotation = annotation;
    }

    UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];


    [infoButton addTarget:self action:@selector(showDetailView) forControlEvents:UIControlEventTouchUpInside];
    annotationView.rightCalloutAccessoryView = infoButton;

    UIImageView *imageV=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"pin.png"]];
    annotationView.leftCalloutAccessoryView=imageV;
    return annotationView;
}

current annotation detail view design(when i click on pin then i can see the annotation detail view )

enter image description here

but i want something like this design

enter image description here

please help me.

Bangalore
  • 1,572
  • 4
  • 20
  • 50

0 Answers0