如何使 MapView 对象透明(alpha)?
所有,
我需要在 MapView 对象上显示信息。那里没有问题。
问题是,有时 MapView 对象显示的地图详细信息在视觉上与我的叠加数据相竞争。
因此,我想做的是提供一种通过使用 alpha 通道在视觉上“缩小”MapView 对象的方法。
alpha 值可以应用于 MapView 对象吗?如果是这样,怎么做?
或者,我在想也许单独的全黑覆盖可以提供相同的结果。缩放此叠加层的 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定要这样做吗?重新审视覆盖层的图形设计可能会更好……简单地给它们加粗边框可能是解决问题的廉价方法。
第一个建议是子类化 MapView 并使用如下内容重写dispatchDraw():
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: