在 Background Layout Drawable 上获取 Facebook 阴影效果

Getting the Facebook Shadow Effect on Background Layout Drawable

我想实现此阴影效果作为我的 RelativeLayout 的可绘制背景:

我正在尝试在我的布局中获得指定的效果。这是描述:

A: Light Stroke around the RelativeLayout

B: Shadow 在布局下和 right 和 left 的轻微阴影布局

我目前拥有的:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#CABBBBBB"/>
            <corners android:radius="2dp" />
        </shape>
    </item>

    <item
        android:left="0dp"
        android:right="0dp"
        android:top="1dp"
        android:bottom="1dp">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="2dp" />
        </shape>
    </item>
</layer-list>

我还应该添加什么才能得到显示的结果?

您也可以使用 CardView

http://developer.android.com/training/material/lists-cards.html

只需添加您自己的海拔即可开始。