![](/img/trans.png)
[英]How to add a drop shadow effect to a circular ImageView in Android?
[英]How to append shadow effect to imageview in android?
我想显示具有阴影效果的3D图像之类的imageview,请帮助我
在res-> drawable文件夹下创建一个xml布局文件。 让我们将其命名为“ image_shadow.xml”,然后将以下代码复制到其中。
<?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="@android:color/darker_gray" />
<corners android:radius="0dp"/>
</shape>
</item>
<item android:right="1dp" android:bottom="2dp">
<shape
android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="1dp"/>
</shape>
</item>
</layer-list>
然后将其应用到您的ImageView
中
android:background="@drawable/image_shadow
希望对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.