Maps V2 Marker pressed states

会有一股神秘感。 提交于 2019-12-14 01:51:36

问题


In Maps V2, how can I set a pressed state to a Marker?

The setIcon() method takes a BitmapDescriptor; I can't see a way to pass an XML selector which would give a pressed and selected state.

Is the only way to achieve this to override the OnMarkerClickListener and change the image programmatically?


回答1:


There is no way to change the icon for the duration of Marker being pressed as of API v2 version 3.1.36.

For the selected state, you may work it around by using OnMarkerClickListener, setting some icon, remembering the reference to this marker and changing it back to normal when another marker is clicked or some other action occures, e.g. onMapClick or onMapLongClick is called.



来源:https://stackoverflow.com/questions/16999827/maps-v2-marker-pressed-states

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!