我有以下适用于iOS 13
和更低的代码。
func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) {
mapView.userLocation.title = "You are here"
mapView.userLocation.subtitle = // user's location
}
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if annotation.isKind(of: MKUserLocation.self) {
return nil
}
}
它只显示没有标注的蓝点,蓝点上方只是标题和副标题。
但在 iOS 14 上,有一个默认的 MKBalloonCalloutView 代替标题和副标题出现。它显示了一个灰色的 profileImage。如何摆脱 BalloonCallout 以便只显示标题和副标题?