1.在drawable文件夹中新建jianbian.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="-90"
android:centerX="50%"
android:centerY="50%"
android:endColor="#2aa5fc"
android:startColor="#186fdc"
android:type="linear"/>
</shape>
2.在布局文件中
android:background="@drawable/jianbian"