【发布时间】:2020-02-20 00:07:29
【问题描述】:
从片段加载时的标记,加载一种颜色,但是单击时它会改变颜色,而我单击标记时没有颜色变化。有什么建议可以解决吗?因为只有在状态逻辑正常的情况下,视图才会在内部发生变化;标记实际上应该是绿色的,但它变成了橙色。
【问题讨论】:
标签: android google-maps android-studio android-activity location
从片段加载时的标记,加载一种颜色,但是单击时它会改变颜色,而我单击标记时没有颜色变化。有什么建议可以解决吗?因为只有在状态逻辑正常的情况下,视图才会在内部发生变化;标记实际上应该是绿色的,但它变成了橙色。
【问题讨论】:
标签: android google-maps android-studio android-activity location
以这种方式设置标记希望对您有所帮助
//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));
【讨论】: