How to make transparent background for CardView in android?

I tried to make a transparent background, but the solutions that I tried didn’t work.

The background color of the parts I marked.

When I click a marker on the map this dialog should open with transparent background. How can I do it?

Answer

If you are using a dialog, then please try

dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

before calling dialog.show()

Leave a Reply

Your email address will not be published. Required fields are marked *