-1

我在星期一上传了一个 App 到 AppStore。一切正常。从星期四开始,添加注释的标题不再可见。

该应用程序有一系列兴趣点。每个都有一个标题和坐标。PoI 正在显示,我可以过滤它们以获得标题。但标题不可见。

预览当前视图

周一预览

4

1 回答 1

0

我只是通过添加以下函数来修复它。不幸的是,它仅通过点击图钉来显示标题。

func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
    guard annotation is MKPointAnnotation else { return nil }

    let identifier = "Annotation"
    var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier)

    if annotationView == nil {
        annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: identifier)
        annotationView!.canShowCallout = true
        
        
    } else {
        annotationView!.annotation = annotation
    }

    return annotationView
}
于 2021-05-29T21:24:17.210 回答