【发布时间】:2015-12-16 14:46:35
【问题描述】:
我在这样的地图上为用户位置设置自定义图像:
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
if annotation.isEqual(mapView.userLocation) {
let identifier = "User"
var annotationView = mapView.dequeueReusableAnnotationViewWithIdentifier(identifier)
if annotationView == nil{
annotationView = CustomPointAnnotation(annotation: annotation, reuseIdentifier: identifier)
annotationView!.canShowCallout = true
} else {
annotationView!.annotation = annotation
}
annotationView!.image = UIImage(named: userImage)
return annotationView
}
return nil
}
我更改了图像属性,如何告诉地图更新 MKAnnotationView?
【问题讨论】:
标签: swift mkmapview mapkit mkannotationview