實現中心到兩邊漸變。angle=90代表上下。從下到上。0代表從左到右。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="90"
android:centerColor="#101010"
/>
</shape>
效果如圖