2017-09-14 50 views
3

我想要一个椭圆形下面的阴影(见下图),但我不知道如何去做,因为形状是透明的颜色。 由于这个原因,我不能使用图层列表,比通过按钮而不是背景看到形状。 我也尝试了半透明阴影,这个工程,但不好看,我宁愿有黑色的影子。在透明的椭圆形下面得到一个阴影在android xml中的形状

这是我想它

enter image description here

预先感谢您

回答

0

设置以下文件到您的视图背景阴影

<?xml version="1.0" encoding="utf-8"?> 
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 

<item> 
    <shape android:shape="oval"> 
     <solid android:color="@color/grey"/> 
     <!--shadow Color--> 
    </shape> 
</item> 

<item 
    android:left="0dp" 
    android:right="0dp" 
    android:top="0dp" 
    android:bottom="3dp"> 
    <shape android:shape="oval"> 
     <solid android:color="@color/white"/> 
    </shape> 
</item>