質問

I have a custom MKAnnotationView appear with a UIImageView by the size 16*16, and when user tap on it, I use the protocol

 - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
    [mapView setCenterCoordinate:view.annotation.coordinate];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [calloutView setHidden:!selected];
}

to pop up a customized calloutView . It can works OK. But sometime it may take two or three times or even more to make the annotation sensitive and invoke the method to show the calloutView. Is there anyone have faced this issue and there is some solution to solve it.

役に立ちましたか?

解決

I have solved it. We must give the customized MKAnnotationView a image and the User Interaction bound is the image's CGSize. So I made a transparent image and assign it to the MKAnnotationView's image property.

self.image=[UIImage imageNamed:@"transparent36.png"];

it works very well.

他のヒント

You should tapp at the center of the MKAnnotationView, and also try adding the

imageView.center = annotationView.center;

try

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top