![](/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.