Android UI shape,selector,layer-list
阴影背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#00000000"
android:startColor="#50000000" />
<corners android:radius="@dimen/_8dp"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<!--渐变-->
<gradient
android:endColor="#AAEFF6"
android:startColor="#87BEF8" />
</shape>
layer-list实现渐变2层阴影背景
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 灰色阴影 -->
<item
android:left="2dp"
android:top="4dp">
<shape>
<solid android:color="@color/gray_d7" />
<corners android:radius="60dp" />
</shape>
</item>
<!-- 白色前景 -->
<item
android:bottom="4dp"
android:right="2dp">
<shape>
<solid android:color="#FFFFFF" />
<stroke android:width="3dp" android:color="#ff5977" />
<corners android:radius="60dp" />
</shape>
</item>
</layer-list>