使用环境:
看看淘宝,它的标题栏是渐变色的
使用方法:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:angle="0" android:centerColor="#3f9bff" android:endColor="#497dff" android:startColor="#35b8ff" android:type="linear" /> </shape>就是一个drawable文件,哪里需要渐变:
android:background="@drawable/bg_jianbian"用到哪里就可以了