- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id) аннотация {
... ... ...
// важный
// иначе calloutAccessoryControlTapped не вызывается
pin.canShowCallout = YES;
pin.calloutOffset = CGPointMake (-10, -10);
UIImageView * leftIconView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "some.png"]];
leftIconView.backgroundColor = [UIColor clearColor];
leftIconView.contentMode = UIViewContentModeScaleAspectFit; * 10171018 * leftIconView.frame = CGRectMake (0, 0, 40, 40);
pin.leftCalloutAccessoryView = leftIconView;
....
....
обратный контакт;
}
- (void) mapView: (MKMapView *) mapView annotationView: (MKAnnotationView *) представление calloutAccessoryControlTapped: (UIControl *) control {
// постукивание по аннотации
float viewWidth = 100;
float viewHeight = 300;
float viewX= 50;
float viewY = 50;
CGRect viewRect = CGRectMake (viewX, viewY, viewWidth, viewHeight);
UIView * viewSub = [[UIView alloc] initWithFrame: viewRect];
viewSub.backgroundColor = [UIColor redColor];
viewSub.tag = 666;
[self.view addSubview: viewSub];
[self.view yieldSubviewToFront: viewSub];
}