Android: Ändern Sie den benutzerdefinierten AlertDialog-Hintergrund
dialog layout xml:
<code><?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> </code>
Dialogimplementierung im Karten-Overlay beim Tippen auf den Pin:
<code>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(); </code>
und was ich beim testen sehe:
Ich möchte, dass der hellgraue Hintergrund um das Dialogfeld (um den quadratischen weißen Raum) in Weiß geändert wird, damit er nicht so hässlich aussieht. Kann mir jemand helfen?