【发布时间】:2012-05-08 00:28:07
【问题描述】:
对话框布局xml:
<?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();
以及我在测试时看到的:
所以我希望对话框周围的浅灰色背景(在方形空白区域周围)变为白色,这样看起来就不会那么难看。谁能帮帮我?
【问题讨论】:
标签: java android android-alertdialog background-color