Does anybody knows how can I set margins to a custom dialog? I\'m asking because I\'ve a custom dialog but when displayed it stretches to fill the parent, even though I set
you could make a new shape drawable resource and set color of it transparent :
then you can add these simple lines in your dialog class onCreate method :
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT);
getWindow().setBackgroundDrawableResource(R.drawable.drawble_resource_you_made_before);
don't forget to put your dialog layout resource background white or any color you want then you could easily by editing your dialog layout resource and customize it :)