Google map v2 Custom Infowindow with two clickable buttons or ImageView

后端 未结 5 2217
青春惊慌失措
青春惊慌失措 2020-12-08 21:14

\"enter

I need custom info window with two clickable button as above.In it when more t

5条回答
  •  轮回少年
    2020-12-08 21:50

    What you are trying to achieve is not possible. Even if you create an XML layout for your info-window, info window contents are rendered and presented as an image on the maps. So it can accept only one click listener for the whole window. You can't specify multiple click listeners for a window.

    UPDATE: From the Docs:

    Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

提交回复
热议问题