小编abb*_*t22的帖子

将地图标记设置为自定义颜色Android

我正在创建一个应用程序,在某些点添加地图的图钉.我希望我的针脚的颜色与我们的应用程序的主题颜色相匹配.对不起,我真的是个菜鸟

int color = Color.rgb(255, 201, 14);
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
final LatLng PERTH = new LatLng(40, -80);
Marker perth = mMap.addMarker(new MarkerOptions()
  .position(PERTH)
  .title("MY PIN")
  .snippet("MAGGIE EATS SNAKE SKINS")
  .draggable(true)
  .icon(BitmapDescriptorFactory.fromResource(R.drawable.pin))
  .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.color)));
Run Code Online (Sandbox Code Playgroud)

.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.color))); 不起作用.它不允许我在这里插入自定义颜色.我怎样才能做到这一点?谢谢:)

android colors markers android-maps-v2

8
推荐指数
1
解决办法
5655
查看次数

标签 统计

android ×1

android-maps-v2 ×1

colors ×1

markers ×1