BUG触摸时标记会改变颜色

时间:2019-10-23 17:19:58

标签: android google-maps android-studio android-activity location

  

从片段加载时加载标记,加载颜色,但是单击该标记会更改颜色,而单击标记时我没有颜色变化。有什么建议可以解决吗?因为只有在视图中才会改变,如果状态逻辑很好,就在内部进行更改;标记实际上应该是绿色,但是变成橙色。

bug in marker, must be green

change color when touch it

1 个答案:

答案 0 :(得分:0)

以这种方式设置标记希望对您有帮助

      //place marker where user just clicked
        marker = googleMap.addMarker(new MarkerOptions()
                .position(latLng)
                .title("You are here!!!")
                .draggable(true)
                .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));                 
        googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15));
相关问题