Is it possible to make a call out accessory view in mapview without an accessory button in it. I am loading a mapview. In some cases, on tapping the pin, I need to show the accessory view, but without an accessory button to tap. Is it possible? If so, how?

有帮助吗?

解决方案

Have you looked at the viewForAnnotation delegate? Using this delegate you can create a custom view for when the pin is tapped.

In here you can do something like this:

MKPinAnnotationView *aView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myPinView"];
aView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];

If you don't set rightCalloutAccessoryView then there will be no accessory button.

Hope this gets you on the right track.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top