1、属性
<shape>
<!-- 实心,即填充颜色-->
<solid android:color="#ff9d77"/>
<!-- 渐变 -->
<!-- 线性渐变 android:type="linear",是默认的模式 -->
<!-- 径向渐变 android:type="radial",需要指定半径android:gradientRadius="50" -->
<gradient
android:startColor="#ff8c00" <!-- 起始颜色 -->
android:endColor="#FFFFFF" <!-- 结束颜色 -->
android:angle="270" /> <!-- 渐变角度,必须是45度的整数倍 -->
<!-- 实线描边 -->
<stroke
android:width="2dp" <!-- 描边宽度 -->
android:color="#dcdcdc" /> <!-- 起始颜色 -->
<!-- 虚线描边 -->
<stroke
android:dashWidth="5dp" <!-- 短横线宽度 -->
android:dashGap="3dp" <!-- 两个横线间的宽度 -->
<!-- 圆角 -->
<corners
android:radius="2dp" /> <!-- 角的弧度,弧度越大,角越圆 -->
<!-- 还可以把四个角设定成不同的角度 -->
<!-- android:topRightRadius="20dp" 右上角 -->
<!-- android:bottomLeftRadius="20dp" 右下角,注意,这里就是Left,很奇怪的地方 -->
<!-- android:topLeftRadius="20dp" 左上角 -->
<!-- android:bottomRightRadius="20dp" 左下角 -->
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>