【发布时间】:2017-06-03 23:36:42
【问题描述】:
我正在尝试使 annotation.image 圆形。但我不知道怎么做。我将如何进行 UIImage 回合。
//Customize Annotation
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
let annotationIdentifier = "Identifier"
var annotationView: MKAnnotationView! = mapView.dequeueReusableAnnotationView(withIdentifier: annotationIdentifier)
if annotationView != nil {
annotationView.annotation = annotation
} else {
annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier)
annotationView.image = profileImage.image
annotationView.canShowCallout = true
annotationView.frame = CGRect(x: 0, y: 0, width: 25, height: 25)
annotationView.autoresizesSubviews = true
annotationView.rightCalloutAccessoryView = UIButton(type: UIButtonType.detailDisclosure) as UIView
}
return annotationView
}
}
【问题讨论】:
标签: ios swift uiimage mapkit mkannotation