Ios 在市场上更改群集注释的颜色。斯威夫特
我正在尝试更改iOS群集注释mapkit的默认颜色swift 有可能吗。我可以更改单个注释,但不能更改集群 下面是我的代码Ios 在市场上更改群集注释的颜色。斯威夫特,ios,swift,mapkit,markerclusterer,Ios,Swift,Mapkit,Markerclusterer,我正在尝试更改iOS群集注释mapkit的默认颜色swift 有可能吗。我可以更改单个注释,但不能更改集群 下面是我的代码 @available(iOS 11.0, *) func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation { let vehicles = M
@available(iOS 11.0, *)
func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation {
let vehicles = MKClusterAnnotation(memberAnnotations: memberAnnotations)
vehicles.title = "Photos"
vehicles.subtitle = nil
return vehicles
}
使用
markerticolor
e、 g
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
let identifier = "marker"
var view: MKMarkerAnnotationView
if let dequeuedView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier)
as? MKMarkerAnnotationView {
dequeuedView.annotation = annotation
view = dequeuedView
} else {
view = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)
view.markerTintColor = .blue
}
return view
}