在google maps api v2中更改标记的InfoWindow视图的边距颜色 [英] Change the margin color of InfoWindow view of marker in google maps api v2
本文介绍了在google maps api v2中更改标记的InfoWindow视图的边距颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好我试图改变默认颜色(白色)为黑色,这在谷歌地图api v2中,任何人都知道我可以做到这一点? PD:是infowindow的边际
这是我改变infowindow内容的代码,但需要更改保证金:S
GoogleMap map = ....
map.setInfoWindowAdapter(new InfoWindowAdapter(){
@Override
public View getInfoContents(Marker marker) {
View v = getLayoutInflater()。inflate(
R.layout.info_window_layout,null);
v.setBackgroundColor(Color.BLACK);
return v;
}
});
感谢您的回覆
解决方案
使用getInfoWindow而不是getInfoContents来提供完整的信息窗口。确保为根视图设置适当的背景,例如在底部中心有一个三角形的东西。
Hello I try to change the default color that have (white) to black, this in the google maps api v2, anyone know how I can do this?
PD: is the margin of infowindow
this is my code where I change the content of infowindow but need change the margin :S
GoogleMap map = ....
map.setInfoWindowAdapter(new InfoWindowAdapter() {
@Override
public View getInfoContents(Marker marker) {
View v = getLayoutInflater().inflate(
R.layout.info_window_layout, null);
v.setBackgroundColor(Color.BLACK);
return v;
}
});
thanks for reply
解决方案
Use getInfoWindow instead of getInfoContents to provide full info window. Make sure to set appropriate backgrounds for root view, e.g. something with a triangle at the bottom center.
这篇关于在google maps api v2中更改标记的InfoWindow视图的边距颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文