Updating MKannotation image without flashing

前端 未结 3 1686
孤独总比滥情好
孤独总比滥情好 2021-02-06 19:33

I want to update the images of some of my annotations on a mapview every 5 seconds, however I dont\' want to remove and re-add them to the map as this causes them to \'flash\' o

3条回答
  •  鱼传尺愫
    2021-02-06 19:40

    Swift version of Anna answer:

    annotation.customImage = ... //the new image
    let av = self.mapView.viewForAnnotation(dnwl!)
    av?.image = annotation.customImage
    

提交回复
热议问题