I am using material cardView in my application. Everything is running smoothly. I have set a background color for my cardView and child element individually. It is fine if I have one card with one child element. But I might have to add multiple cards with multiple child elements. My question is
Is it possible to give just one background color for entire cardView including child elements ?
<com.google.android.material.card.MaterialCardView
android:id="@+id/cardView2"
android:layout_width="290dp"
android:layout_height="140dp"
app:cardBackgroundColor="@color/Grey">
<TextView
android:id="@+id/textViewCardTown2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:backgroundTint="@color/LightGrey"
android:fontFamily="sans-serif"
android:textAlignment="center"
android:textColor="@color/colorPrimaryDark"/>
</com.google.android.material.card.MaterialCardView>
You can set the background color of the child layout to transparent.
Set:
android:background="00000000";