<?xml version="1.0" encoding="utf-8"?>
<gradient>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:type="linear"
android:centerX="35%"
android:startColor="#FF4D0000"
android:centerColor="#FF4D0000"
android:endColor="#FFe5f011"
android:angle="225"/>
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:startColor="#FF4D0000"
android:centerColor="#FF4D0000"
android:endColor="#FFe5f011"
android:gradientRadius="35"/>
</shape>
</gradient>
这是我形成的称为渐变的形状,我分配它的方式是:
android:background="@drawable/gradient"