MKPolyline / MKPolylineRenderer changing color without remove it

前端 未结 2 966
眼角桃花
眼角桃花 2021-01-02 17:37

I working around with map app, I want to ask how to change the polyline color without remove and add it again, I found this topic https://stackoverflow.com/questions/2422629

2条回答
  •  庸人自扰
    2021-01-02 18:11

    Yous hould look at MKOverlayPathRenderer method - invalidatePath.

    From the doc, it says:

    Call this method when a change in the path information would require you to recreate the overlay’s path. This method sets the path property to nil and tells the overlay renderer to redisplay its contents.

    So, at this moment, you should be able to change your drawing color.

提交回复
热议问题