添加按钮来映射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.

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

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...