Recently, a behavior in iOS map annotation changed :
The event CalloutAccessoryControlTapped
is no more called whe the user tap on the annotation view. For example if i tap on the red area in the image above. The only way to trigger the event is to tap on the information button to the right.
Is there a way to force CalloutAccessoryControlTapped
to raise when we tap on the whole surface of the annotation ?
protected override void OnElementChanged(ElementChangedEventArgs<View> e)
{
base.OnElementChanged(e);
if (Control is MKMapView nativeMap)
{
if (e.OldElement != null)
{
nativeMap.RemoveAnnotations(nativeMap.Annotations);
nativeMap.GetViewForAnnotation = null;
nativeMap.CalloutAccessoryControlTapped -= OnCalloutAccessoryControlTapped;
}
if (e.NewElement != null)
{
CustomMap = (CustomMap)e.NewElement;
nativeMap.GetViewForAnnotation = GetViewForAnnotation;
nativeMap.CalloutAccessoryControlTapped += OnCalloutAccessoryControlTapped;
}
}
}
// event delegate
private void OnCalloutAccessoryControlTapped(object sender, MKMapViewAccessoryTappedEventArgs e)
{
// ...
}