How to make MapView object transparent (alpha)?

空扰寡人 提交于 2019-12-01 14:33:48

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
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!