开发者

How to make MapView object transparent (alpha)?

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 details that visually compete with my overlay data.

So, what I'd like to do is provide a way to "scale back" the MapView object visually by using an alpha channel.

Can an alpha value get applied to a MapView object? If so, how?

Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the alpha of this overlay and I might end up with the same overall effect.

Insight please.

Thanks.

Rich


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜