Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>@interface CustomAnnotaionView : MKAnnotationView @property (strong, nonatomic) UIView *calloutView; -(void)setSelected:(BOOL)selected animated:(BOOL)animated; @end @implementation CustomAnnotaionView @synthesize calloutView = _calloutView; -(void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if(selected) { [self.calloutView setFrame:CGRectMake(30, 130, 250, 135)]; [self.calloutView sizeToFit]; self.calloutView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"popup.png"]]; [self addSubview:self.calloutView]; } else { [self.calloutView removeFromSuperview]; } } -(void)didAddSubview:(UIView *)subview { if([[[subview class]description]isEqualToString:@"UICalloutView"]) { [subview removeFromSuperview]; } } Use this customAnnotationView class in MapView delegate method, - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation { if([annotation isKindOfClass:[MapAnnotation class]]) { CustomAnnotationView *annotationView = (CustomAnnotaionView*)[theMapView dequeueReusableAnnotationViewWithIdentifier:@"CustomAnnotationView"]; if(!annotationView) { MapAnnotation *annotation = (MapAnnotation *)annotation; annotationView = [[CustomAnnotaionView alloc]initWithAnnotation:annotation reuseIdentifier:@"CustomAnnotationView"]; [annotationView setCanShowCallout:YES]; } else annotationView.annotation = annotation; return annotationView; } return nil; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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