Android怎么做一个阴影的效果
QQ图片20180105103615.png
1.首先做一个shape文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:endColor="#3f363636"
android:type="linear"
android:startColor="#00000000" />
</shape>
2.然后是添加透明度
<View
android:alpha="0.5"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentBottom="true"
android:background="@drawable/elevation" />
这样就完成了。如果想要更好的效果 自己调整哟。