I have a custom one MKAnnotationView. In my method, setselected:animatedI add a custom bubble loaded from the tip to it, adjust the annotation view frame to include this view, and redraw the annotation circle in a different color, for example (the first is not selected, the second is selected, blue is the frame, green is the user view bubble with alpha = 0.8, red - abstract):

It works fine, the bubble appears and can only be "closed" by clicking on it (so I enlarged the frame). I have buttons on this bubble and they are available for clicks if there is nothing under the annotation only on the map.
BUT, when there is another annotation under the stem bubble, I can click through the entire bubble. When I press one of the buttons, a red highlight appears, but the other annotation is selected because it didSelectAnnotationViewworks ...
I tried to make the bubble opaque / translucent, no luck; set exclusiveTouch on buttons, in the view itself, no luck; I tried not to get confused with the frame, you can still click. Am I missing something?
thank
Change : . In short. Why can I go through UIViewthat added to addSubviewin MKAnnotationView if there is another MKAnnotaionView in this UIView?
Details:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
if(selected)
{
initialFrame = self.frame;
initialOffset = self.centerOffset;
if (!self.customCallout)
{
self.customCallout = [[[NSBundle mainBundle] loadNibNamed:@"CustomCallout" owner:self options:nil] objectAtIndex:0];
}
self.customCallout.layer.cornerRadius=5;
self.customCallout.exclusiveTouch = YES;
[self addSubview:self.customCallout];
}
...
}
initWithAnnotation has the following meanings:
self.canShowCallout = NO;
self.exclusiveTouch = YES;
self.enabled = YES;
self.opaque = YES;