android:bottomLeftRadius=“10dp” // 左下角的圆角半径
android:bottomRightRadius=“10dp” /> // 右下角的圆角半径
solid
:用以指定内部填充色。
// 内部填充色
gradient
:用以定义渐变色,可以定义两色渐变
、三色渐变
及渐变样式
。
<gradient
android:type=[“linear” | “radial” | “sweep”] // 共有3中渐变类型:线性渐变(默认)、放射渐变、扫描式渐变;
android:angle=“90” // 渐变角度,必须为45的倍数,0为从左到右,90为从上到下;
android:centerX=“0.5” // 渐变中心X的相当位置,范围为0~1;
android:centerY=“0.5” // 渐变中心Y的相当位置,范围为0~1;
android:startColor=“#24e9f2” // 渐变开始点的颜色;
android:centerColor=“#2564ef” // 渐变中间点的颜色,在开始与结束点之间;
android:endColor=“#25f1ef” // 渐变结束点的颜色;
android:gradientRadius=“5dp” // 渐变的半径,只有当渐变类型为radial时才能使用;
android:useLevel=“false” /> // 使用 LevelListDrawable 时就要设置为true。设为 false 时才有渐变效果。
stroke
:是描边属性,可以定义描边的宽度
、颜色
、虚实线
等。
<stroke
android:width=“1dp” // 描边的宽度
android:color=“#ff0000” // 描边的颜色
// 以下两个属性设置虚线
android:dashWidth=“1dp” // 虚线的宽度,值为0时是实线
android:dashGap=“1dp” /> // 虚线的间隔
padding
:用来定义内部边距。
<padding