<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 圆角 -->
<corners
android:radius="180dp"
android:topLeftRadius="180dp"
android:topRightRadius="180dp"
android:bottomLeftRadius="180dp"
android:bottomRightRadius="180dp"/>
<!-- 分别设置上下左右的圆角的半径-->
<!-- 留空 -->
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp"/>
<!--上下左右分别留空当 -->
<!-- 宽高 -->
<size
android:width="300dp"
android:height="300dp"/>
<!-- 一般不特地设置,因为可以引用时调大小 -->
<!-- 内部填充(单色) -->
<solid
android:color="@color/primary"/>
<!-- 渐变色设置 -->
<gradient
android:startColor="#ffffff"
android:centerColor="#000000"
android:endColor="#000000"
android:useLevel="true"
android:angle="270"
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="90"/>
<!--startColor,开始的颜色,endcolor渐变最后的颜色,centerColor中间的颜色-->
<!--style有三种,linear(线性),radial(放射性),sweep(扫描性)-->
<!--linear从一个方向到另一个方向-->
<!--当angle=0时,渐变色是从左向右。-->
<!--然后渐变方向随angle增加而逆时针方向转,当angle=270时为从上往下,且只有type为center时有效 –>-->
<!--radial 从一个点开始的渐变-->
<!--android:centerX Float.(0 - 1.0) 渐变点x轴相对位置。-->
<!--android:centerY! Float.(0 - 1.0) 渐变点Y轴相对位置。-->
<!--这两个属性只有在type不为linear情况下起作用。-->
<!--android:useLevel="true| false"默认为false,且只有当其为false时才有渐变效果-->
<!-- 外部描边 --> <stroke android:width="2dp"
android:color="@color/primary"
android:dashWidth="1dp"
android:dashGap="2dp"/>
<!-- width为所描边的宽度 -->
<!--而破折线(断断续续的线)每一段的宽度为dashWith-->
<!--破折线(断断续续的线)之间的空隙的宽度为dashGap-->
</shape>