需求:要完成颜色的渐变。
做法:使用 xml文件,结合 shape完成
————————————————————————————————————————————
设置颜色的渐变,可以通过res/drawable里定义的一个xml 完成,如:/TestColor/res/drawable/color_shape.xml
写法儿如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!--
startColor : 设置渐变颜色的开始值
endColor: 设置渐变颜色的结束值
angle : 设置渐变的角度
90 :从下往上开始渐变
0 :从左往右开始渐变
-->
<gradient
android:startColor="#FFF"
android:endColor=