I try to provide elevation
in the corners cardview
. my demand elevation
should not affect the middle cardview
. it should only act on corners, as shown in the figure below.

As shown in the figure, in the middle cardview
elevation
must be zero at the corners, must have some elevation
(eg
elevation:4dp
)
Here is the code I've tried so far
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@null"
android:gravity="center"
card_view:cardBackgroundColor="@android:color/white"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="3dp">
source
share