MKPolyLineRenderer change color without removing o

2020-07-26 11:58发布

I am developing an application that almost replicates Apple maps application behavior. When i touch a route, i need to change its color to blue and change the other ones colors to gray. Is there an efficient way to accomplish this without having to remove the overlays and adding them again ? Thanks.

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-07-26 12:05

Yes:

  1. Make sure your annotation view has enabled = YES.

  2. Implement -[MKMapViewDelegate mapView:didSelectAnnotationView:].

  3. In that callback, get view and change its properties.

查看更多
登录 后发表回答