如何编辑字形图像图标斯威夫特4?

问题描述 投票:-1回答:1

我是新来迅速4.2,我想知道我可以编辑在迅速4.例如字形像图钉图标,而不是红色标记与针会不会是一个红色标记与快餐图标?谢谢您的帮助。

这里是我的代码:

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
} 
ios swift mapkit
1个回答
1
投票

你不能编辑它,但你肯定可以取代它。只需设置MKMarkerAnnotationView的glyphImage

© www.soinside.com 2019 - 2024. All rights reserved.