在android google map v2中更改折线的颜色

在android google map v2中更改折线的颜色,第1张

概述我从这个链接https://developers.google.com/maps/documentation/android/shapes#customizing_appearances找到了这个代码Polylineline=map.addPolyline(newPolylineOptions().add(newLatLng(-37.81319,144.96298),newLatLng(-31.95285,115.85734)).width(25)

我从这个链接https://developers.google.com/maps/documentation/android/shapes#customizing_appearances找到了这个代码

polyline line = map.addpolyline(new polylineoptions()    .add(new LatLng(-37.81319, 144.96298), new LatLng(-31.95285, 115.85734))    .wIDth(25)    .color(color.BLUE)    .geodesic(true));

我的问题是color.Blue中的颜色返回错误,说明当前上下文中的名称color不存在.

解决方法:

只需在颜色资源文件中定义颜色,然后执行以下 *** 作:

polylineoptions rectline = new polylineoptions().wIDth(4).color(context.getResources().getcolor(R.color.cyan));

对我来说很棒.

总结

以上是内存溢出为你收集整理的在android google map v2中更改折线的颜色全部内容,希望文章能够帮你解决在android google map v2中更改折线的颜色所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1119948.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存