I have a CardView inside another CardView, but the child CardView doesnt have shadow around it. Any idea why?
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
card_view:cardBackgroundColor="@color/WHITE_COLOR"
card_view:cardCornerRadius="20dp"
card_view:cardElevation="3dp"
card_view:cardPreventCornerOverlap="false"
card_view:contentPadding="0dp">
<android.support.v7.widget.CardView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
card_view:cardBackgroundColor="@color/RED_COLOR"
card_view:cardCornerRadius="20dp"
card_view:cardElevation="6dp"
card_view:cardPreventCornerOverlap="false"
card_view:contentPadding="0dp">
</android.support.v7.widget.CardView>
</android.support.v7.widget.CardView>
I have met exactly the same problem
card_view:cardUseCompatPadding="true"
solved it
so every card looks like
<android.support.v7.widget.CardView
card_view:cardUseCompatPadding="true"
card_view:cardElevation="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
...
</android.support.v7.widget.CardView>
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