在drawable文件夹下创建一个xml文件:
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#ffa6a6a6"
android:centerColor="#ffdbdbdb"
android:endColor="#ffe7e7e7"
android:height="1px"
android:angle="90"
android:dither="true" />
</shape>
</item>
</layer-list>