0

I've map view in which I've few MKPointAnnotation.

All it's working, BUT, the "background" of the view's MKPoiintAnnotation are "invisible", and so it's not very "visible".

I wanted to change te background to white, I tried to use :

  • (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation

But I didn't succeed to change the background with this method. What I need to use ? Thx,

EDIT : By "background", I want to mean, the background under the text "Current Location" (for this example) :

enter image description here

EDIT 2 :

I'm using this code to add annotation :

                annotationPoint = [[MKPointAnnotation alloc] init];
            annotationCoord.latitude = [[item getPlace] getLatitude];
            annotationCoord.longitude = [[item getPlace] getLongitude];
            annotationPoint.coordinate = annotationCoord;
            annotationPoint.title = item.getNom;
            annotationPoint.subtitle = [Utils getDateString :item.getDeadline :@"dd/MM/yyyy HH:mm"];
            [_mapView addAnnotation:annotationPoint];
deveLost
  • 1,151
  • 2
  • 20
  • 47

2 Answers2

1

You need to build a custom annotation, you might want to follow this tutorial:

http://blog.asynchrony.com/2010/09/building-custom-map-annotation-callouts-part-2/

Kenan Karakecili
  • 731
  • 6
  • 23
0

If your MapView is within a UITableView then you need to set the selectionStyle to UITableViewCellSelectionStyle.None.

For example in Swift, I added the following to the awakeFromNib function of the custom table cell class:

override func awakeFromNib() {
    super.awakeFromNib()

    // Selection style for the cell
    self.selectionStyle = UITableViewCellSelectionStyle.None
}
Imran A
  • 1
  • 1