gpt4 book ai didi

android - 添加按钮到 map infowindow android

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:22:58 25 4
gpt4 key购买 nike

在新的 Google Maps for Android API v2 中,我可以非常轻松地显示自定义标记和信息窗口。但是,我试图在我的信息窗口中设置多个按钮,每个按钮执行不同的 onClick 操作,但问题是, map 将 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 - 添加按钮到 map infowindow android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13810002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com