Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个应用程序,我需要显示来自服务器 url 的图像,因为谷歌地图上的注释(标记)类似于用户的个人资料图片。如何使用布局或自定义视图作为标记?
感谢 RawCoder
您可以使用OverlayItem.setMarker().
OverlayItem.setMarker()
overlayItem.setMarker(icon);
您从 URL 中检索到的icon内容在哪里。Drawable
icon
Drawable
除了您的评论和您编辑的问题之外,请编辑:
我建议您将您在问题中发布的一张图片添加到资源 drowables 中,并将其用作基础可绘制对象。从您的 URL 中检索自定义图像并将其覆盖到现有的图像上,创建一个新的可绘制图像,您将能够使用setMarker().
setMarker()
点击将被 捕获Overlay.onTap()。
Overlay.onTap()