dialog layout 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>
dialog implementation in map overlay when tapped on pushpin:
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();
and what I see when test it:
So I want that light grey background around dialog box (around square white space) change to white, so it won't look that ugly. Can anyone help me?
I had the same problem, I managed to fix it using a custom dialog like this:
Another option is to remove
android:background="@android:color/white"
from your layout. Then the alert dialog will have its default light grayish background uniformly. (Since you have forced an inverse on a dark theme) At least it would look nice and worth the hassle. Just my two cents.Hey setting your view to builder creates this gray lines on top-bottom,instead you can setView to your dialog.like dialog.setView(layout,0,0,0,0);It will bound your layout to whole dialog.