对话框布局的xml:安卓:更改自定义AlertDialog背景
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_view"
android:padding="3dp"
android:background="@android:color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
//...content...
</TableLayout>
上图钉挖掘时,在地图覆盖
对话框实现:
AlertDialog.Builder builder;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.map_kap_dialog,
(ViewGroup) mapView.findViewById(R.id.root_view));
//prepare info to show...
//info prepared
//other preparations stuff
builder = new AlertDialog.Builder(context);
builder.setView(layout);
dialog = builder.create();
dialog.setInverseBackgroundForced(true);
dialog.setCanceledOnTouchOutside(true);
//show it
dialog.show();
,我看到的,当测试:
所以我想围绕对话框的浅灰色背景(围绕s quare白色空间)变成白色,所以它不会看起来很丑。谁能帮我?