Cardview shadow not showing properly on api 18

Viewed 59

I am using cardview like this:

 <com.google.android.material.card.MaterialCardView
        android:id="@+id/togglebuysell"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="15dp"
        android:layout_marginBottom="10dp"
        app:cardCornerRadius="15dp"
        app:cardElevation="5dp">

The result on devices running api >21 is : enter image description here Which is OK But on devices running api 18 the result is:

enter image description here The shadow looks bizarre. any solution to fix this on all api versions?

1 Answers
Related