Gradient along MKPolyLineView ( MKPolylineRenderer )

前端 未结 1 476
故里飘歌
故里飘歌 2020-12-31 12:07

I\'d like to apply a gradient on a polyline view depending on some conditions like speed. I was able to subclass MKPolyLineRenderer to draw with custom stroke

相关标签:
1条回答
  • 2020-12-31 12:13

    So the original answer is here https://stackoverflow.com/a/20159374/2606068

    you can find the demo here https://github.com/wdanxna/GradientPolyline

    and some improvement tips provided by @Templar is:

    • prepare the path directly in the init.
    • check also for CGRectContains, not only for intersection.

    thanks man! :p

    0 讨论(0)
提交回复
热议问题