在google maps api v2中更改标记的InfoWindow视图的边距颜色

Vin*_*DSL 9 android google-maps infowindow google-maps-markers

您好我尝试将(白色)的默认颜色更改为黑色,这在google maps 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;
            }
        });
Run Code Online (Sandbox Code Playgroud)

谢谢你的答复

Mac*_*ski 39

使用getInfoWindow而不是getInfoContents来提供完整的信息窗口.确保为根视图设置适当的背景,例如底部中心有三角形的东西.

  • 可能仍然使用默认信息窗口并打开; y删除填充?如果您想要做的就是删除填充,那么您必须自己实现整个窗口. (3认同)

Lib*_*mas 7

在 InfoWindowAdapter 更改为

@Override
    public View getInfoWindow(Marker marker) {
        View view = ((Activity)context).getLayoutInflater()
                .inflate(R.layout.map_custom_infowindow, null);
        return view;
    }

    @Override
    public View getInfoContents(Marker marker) {

        return null;
    }
Run Code Online (Sandbox Code Playgroud)