Home > Software design >  In an alert dialog, how can I reduce the spacing between the 'message' and my view?
In an alert dialog, how can I reduce the spacing between the 'message' and my view?

Time:10-20

For example, the following code:

AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("foo");
builder.setMessage("bar");
EditText edit = new EditText(activity);
builder.setView(edit);
builder.show();

enter image description here

and a FrameLayout named "customPanel" that holds the EditText

enter image description here

The Space widget has a specified height of 18dp (which we shall see in a moment) while the FrameLayout has a minimum height of 48dp which can be seen in the attributes of the Layout Inspector.

The layout used by AlertDialog is enter image description here

  • Related