Force MKMapView viewForAnnotation to update

后端 未结 5 1063
忘掉有多难
忘掉有多难 2021-02-12 22:05

So I have a MKMapView with all my pins added, and the colour of the pin is dependent on whether a value is set for that pin. When I first load the app, viewForAnnotation

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-12 22:39

    Due to the way the map view caches its annotations, you NEED to remove and re-add the annotation if you need to make changes to its appearance. A simple remove & add is the way to go. There is no cache invalidating mechanism but this.

提交回复
热议问题