How to create Drop shadow for a cardview in Android kotlin

2 weeks ago 11
ARTICLE AD BOX

enter image description here Here top view is the needed view
below is the view which I tried to replicate but not getting perfect view as I tried to create a drop shadow for the cardview but I want only shadow or elevation whatever it is, I need only at the bottom of view

<androidx.cardview.widget.CardView android:id="@+id/cvTest" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/_8sdp" android:outlineSpotShadowColor="@color/colorBlack" app:cardCornerRadius="@dimen/_12sdp" android:translationZ="@dimen/_2sdp" app:cardElevation="@dimen/_4sdp" app:layout_constraintTop_toBottomOf="@+id/tvtest"> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/tvtest1" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_margin="@dimen/_22sdp" android:text="@string/app_name" /> </androidx.cardview.widget.CardView>

here is the code snippet which I have tried to create a replica

Read Entire Article