Ios 如何在单个点显示多个注释详细信息?
我在xamarin ios工作。我正在使用MKMapView显示一些位置。我有一些任务和地点(纬度,经度)。我已经在地图上映射了位置,当用户单击注释点时,它会显示任务的描述Ios 如何在单个点显示多个注释详细信息?,ios,xamarin.ios,mkmapview,Ios,Xamarin.ios,Mkmapview,我在xamarin ios工作。我正在使用MKMapView显示一些位置。我有一些任务和地点(纬度,经度)。我已经在地图上映射了位置,当用户单击注释点时,它会显示任务的描述 但在某些情况下,多个任务可以具有相同的位置,因此在这种情况下,当用户单击注释点时,任务描述将逐个显示。但我希望,当用户单击注释点时,该点的所有任务描述应该像列表一样显示在一起。如何在xamarin ios中实现这一点?使用自定义注释视图显示该点的所有任务描述: public override MKAnnotationView
但在某些情况下,多个任务可以具有相同的位置,因此在这种情况下,当用户单击注释点时,任务描述将逐个显示。但我希望,当用户单击注释点时,该点的所有任务描述应该像列表一样显示在一起。如何在xamarin ios中实现这一点?使用自定义注释视图显示该点的所有任务描述:
public override MKAnnotationView GetViewForAnnotation (MKMapView mapView, NSObject annotation)
{
if (annotation is MKUserLocation){
return null;
}
//Use a custom annotationView instead, which inherited from MKAnnotationView, has a label to display description.
ACustomMKAnnotationView annotationView = mapView.DequeueReusableAnnotation (annotationId);
if (annotationView == null) {
annotationView = new ACustomMKAnnotationView (annotation, annotationId);
}
annotationView.descriptionLabel.text = "All the task description joined";
annotationView.CanShowCallout = true;
return annotationView;
}
参考: