首页 > 解决方案 > 谷歌地图信息窗口背景不适用于边框

问题描述

我的自定义信息窗口有问题。我所做的只是将背景设置为@color/wallet_holo_blue_light。这是我的 xml 和 java 自定义窗口的源代码:

<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/wallet_holo_blue_light"
>

private Context context;

public CustomInfoWindowAdapter(Context ctx){
    context = ctx;
}

@Override
public View getInfoWindow(Marker marker) {
    return null;
}

@Override
public View getInfoContents(Marker marker) {

    View view = ((Activity)context).getLayoutInflater()
            .inflate(R.layout.custom_info_window, null);

    TextView name_tv = view.findViewById(R.id.windowinfo_title);
    TextView adress = view.findViewById(R.id.windowinfo_adress);
    TextView infotext = view.findViewById(R.id.windowinfo_text);

    name_tv.setText(marker.getTitle());

    adress.setText(marker.getSnippet());

    return view;
}

这是它在地图中的样子:信息窗口

我想找到一种方法也将边框和小底箭头设置为相同的颜色。

提前致谢 !

标签: androidandroid-layout

解决方案


推荐阅读