I use AlertDialog.Builder to make a custom dialog using these instructions: http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
It works, but my view is inside a black box (the standard dialog frame). This box has padding around its edges, so i cant make it use the full display width.
How can I get rid of the padding? I fetched the layoutparams after the dialog is displayed, and changed all the parameters and flags, nothing helped.
When someone else asked this here on SO, the answer was
builder.setView(dialogView, 0, 0, 0, 0);
but as far as I see, this method doesnt exist, only setView(dialogView).
It's not builder.setView You need to create an instance of the dialog first:
Dialog dialog = builder.create();
dialog.setView(dialogView, 0, 0, 0, 0);
I believe the only way to do this is to use the base (or extended) Dialog class and setView to set a custom view.
You'll also have to add your own buttons and handle them accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With