Ios 如何编辑字形图像图标Swift 4?
我是swift 4.2的新手,我想知道我是否可以在swift 4中编辑字形图像pin图标。例如,它是否可以作为带有快餐图标的红色标记,而不是带有pin的红色标记?谢谢你的帮助 这是我的密码:Ios 如何编辑字形图像图标Swift 4?,ios,swift,mapkit,Ios,Swift,Mapkit,我是swift 4.2的新手,我想知道我是否可以在swift 4中编辑字形图像pin图标。例如,它是否可以作为带有快餐图标的红色标记,而不是带有pin的红色标记?谢谢你的帮助 这是我的密码: func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { let identifier = "marker" var view: MKMarkerAn
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.canShowCallout = true
view.calloutOffset = CGPoint(x: -5, y: 5)
view.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
}
return view
}
您不能编辑它,但您肯定可以替换它。只需设置mkmarkerNotationView的
glyphImage
查看文档中mkmarkerNotationView的glyphImage
。