我从这个链接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中更改折线的颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)