我所做的是在我的菜单视图(即背后视图)的右侧放置一个阴影,并在您的上方视图右侧放置一个边距:
<!-- Show shadow on the right of the menu -->
<RelativeLayout
android:id="@+id/menuShadow"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:focusable="false"
android:clickable="false"
android:background="#00000000"
android:layout_marginRight="40dp">
<ImageView
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_width="6dp"
android:layout_height="fill_parent"
android:background="@layout/border_menu_progressive_shadow"/>
</RelativeLayout>
使用我的阴影布局:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#00101010"
android:endColor="#252525"
android:angle="0" />
</shape>
</item>
</selector>