I'm creating an AlertDialog
and the custom layout for that dialog is a CardView
(the card is the root of the xml layout):
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/moreInfoCard"
android:layout_gravity="center"
app:cardCornerRadius="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
//my layout content
</android.support.v7.widget.CardView>
When I show the dialog the card has its corners rounded, but the background of the corners it's not transparent.
How can I solve this issue? Thank you in advance.
call alertDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
to set the AlertDialog
's background to transparent and it will work
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