Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom MKAnnotationView with frame,icon and image
    primarykey
    data
    text
    <p>I've been searching for a similar solution on how to design a custom MKAnnotationView like this one.</p> <p><img src="https://i.stack.imgur.com/MzJL4.jpg" alt="enter image description here"></p> <p>I'v subclassed the MKAnnotation and i was able to add an image named F.png the F.png is a frame image as showed in the picture. what i want is to add an inner image. (colored Blue in the picture i draw)</p> <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation { if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; static NSString* AnnotationIdentifier = @"AnnotationIdentifier"; MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier]; if(annotationView) return annotationView; else { MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier]; annotationView.canShowCallout = YES; annotationView.image = [UIImage imageNamed:[NSString stringWithFormat:@"F.png"]]; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(writeSomething:) forControlEvents:UIControlEventTouchUpInside]; [rightButton setTitle:annotation.title forState:UIControlStateNormal]; annotationView.rightCalloutAccessoryView = rightButton; annotationView.canShowCallout = YES; annotationView.draggable = NO; return annotationView; } return nil; } </code></pre>
    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.
 

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