How to make MapView object transparent (alpha)?

后端 未结 1 1445
说谎
说谎 2021-01-16 18:59

All,

I have a need to display information on a MapView object. No problems there.

The issue is that there are times when the MapView object displays map det

相关标签:
1条回答
  • 2021-01-16 19:32

    Are you sure you want to do this? It might be better to revisit your overlay's graphic design... simply giving them a thicker border might be a cheap solution to the problem.

    First suggestion would be to subclass MapView and override dispatchDraw() with something like this:

    @Override protected void dispatchDraw(Canvas canvas) {
    
      // Firstly let MapView draw
      super.dispatchDraw(canvas);
    
      // Draw a translucent fill on top of it
      canvas.drawColor(0x7FFFFFFF);
    
      // TODO: Draw my overlay
    }
    
    0 讨论(0)
提交回复
热议问题