答案 0 :(得分:2)
在您的XML中添加:
android:elevation="2dp"
android:background="@drawable/myrect"
在Drawable文件夹中添加此drawable:
<!-- res/drawable/myrect.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#42000000" />
<corners android:radius="5dp" />
</shape>
有关详细信息,请参阅此处:http://developer.android.com/training/material/shadows-clipping.html