1.颜色从上至下的渐变
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135" //方向改变
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>
2.层次感的xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="5.66dp"
>
<!-- 底层-->
<shape
android:shape="rectangle">
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
//颜色渐变背景
<gradient
android:angle="90"
android:centerColor="#00695C"
android:endColor="#009688"
android:startColor="#fff"
android:type="linear" />
</shape>
</item>
<!-- 上一层-->
<item
android:top="5.66dp"
android:left="3dp"
android:right="3dp">
<shape
android:shape="rectangle">
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<solid android:color="#fff"/>
</shape>
</item>
</layer-list>