【发布时间】:2023-03-17 08:39:01
【问题描述】:
【问题讨论】:
-
你解决了吗?
-
@AyushSth 刚刚将其添加为带有阴影的png,如上图所示......那是2015年......也许现在可以正确解决但不确定。
【问题讨论】:
在您的 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
【讨论】: