對話框佈局的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白色空間)變成白色,所以它不會看起來很醜。誰能幫我?