Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same problem. There is a serious of blog posts about this topic on this blog <a href="http://spitzkoff.com/craig/?p=81" rel="nofollow noreferrer">http://spitzkoff.com/craig/?p=81</a>.</p> <p>Just using the <code>MKMapViewDelegate</code> doesn't help you here and subclassing <code>MKMapView</code> and trying to extend the existing functionality also didn't work for me.</p> <p>What I ended up doing is to create my own <code>CustomCalloutView</code> that I am having on top of my <code>MKMapView</code>. You can style this view in any way you want.</p> <p>My <code>CustomCalloutView</code> has a method similar to this one:</p> <pre> <code> - (void) openForAnnotation: (id)anAnnotation { self.annotation = anAnnotation; // remove from view [self removeFromSuperview]; titleLabel.text = self.annotation.title; [self updateSubviews]; [self updateSpeechBubble]; [self.mapView addSubview: self]; } </code> </pre> <p>It takes an <code>MKAnnotation</code> object and sets its own title, afterward it calls two other methods which are quite ugly which adjust the width and size of the callout contents and afterward draw the speech bubble around it at the correct position.</p> <p>Finally the view is added as a subview to the mapView. The problem with this solution is that it is hard to keep the callout at the correct position when the map view is scrolled. I am just hiding the callout in the map views delegate method on a region change to solve this problem.</p> <p>It took some time to solve all those problems, but now the callout almost behaves like the official one, but I have it in my own style.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload