添加按钮来映射infowindow android

前端之家收集整理的这篇文章主要介绍了添加按钮来映射infowindow android前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在新的Google Maps for Android API v2中,我可以轻松获得自定义标记和信息窗口.但是,我正在尝试在信息窗口中有多个按钮,每个按钮都执行不同的onClick操作,但问题是,该图将InfoWindow视为自己的按钮对象(无论我在InfoWindow上单击什么,都会按整个事情).有谁知道如何自定义这一点?

解决方法

刚刚在 documentation发现.

As mentioned in the prevIoUs section on info windows,an info window
is not a live View,rather the view is rendered as an image onto the
map. As a result,any listeners you set on the view are disregarded
and you cannot distinguish between click events on varIoUs parts of
the view. You are advised not to place interactive components — such
as buttons,checkBoxes,or text inputs — within your custom info
window.

不幸的是,这回答了.我试图添加与你相同的功能.

原文链接:https://www.f2er.com/android/313085.html

猜你在找的Android相关文章