Android removes the default shadow of CardView. CardView usually has a shadow effect by default. If you don’t want the shadow effect, just set the following properties to 0:
app:cardElevation="0dp"
app:cardMaxElevation="0dp"
Copy the code
The complete use is as follows:
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:cardBackgroundColor="#ffffff"
app:cardCornerRadius="10dp"
app:cardElevation="0dp"
app:cardMaxElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
.......
</LinearLayout>
</androidx.cardview.widget.CardView>
Copy the code