如何将高度添加到透明 ImageView [android]

How to add elevation to transparent ImageView [android]

真的是用透明背景的png实现ImageView的提升吗?例如:我想给这张照片添加高程阴影:

想做成这样:

在您的 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