我正在尝试制作annotation.image。但我不知道如何。我将如何去做一个UIImage轮。如何制作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
}
}
Currently looks like this on a map
试过了。但是,当我将maskToBound设置为true时 - > clipToBounds = YES;图层=>无法显示调用clipToBounds启用' ***第一次抛出调用堆栈: –
JoseMelendez