Vector常用语法了解:
M = moveto(M X,Y) :将画笔移动到指定的坐标位置
L = lineto(L X,Y) :画直线到指定的坐标位置
H = horizontal lineto(H X):画水平线到指定的X坐标位置
V = vertical lineto(V Y):画垂直线到指定的Y坐标位置
C = curveto(C X1,Y1,X2,Y2,ENDX,ENDY):三次贝赛曲线
S = smooth curveto(S X2,Y2,ENDX,ENDY):平滑曲线
Q = quadratic Belzier curve(Q X,Y,ENDX,ENDY):二次贝赛曲线
T = smooth quadratic Belzier curveto(T ENDX,ENDY):映射
A = elliptical Arc(A RX,RY,XROTATION,FLAG1,FLAG2,X,Y):弧线
A(圆的x轴半径,y轴半径,x轴旋转角度,0/1-小/大弧度,0/1-逆/顺时针,圆的终点位置x点,圆的终点位置y点)
Z = closepath():关闭路径
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="300dp"
android:height="300dp"
android:viewportWidth="99"
android:viewportHeight="99">
<path
android:pathData="M0,0 H99 M0,0 V99 M99,99 H0 M99,99 V0"
android:strokeWidth="2"
android:strokeColor="#000000">
<aapt:attr name="android:fillColor">
<gradient
android:angle="0"
android:centerColor="#B451EC"
android:endColor="#62A7F0"
android:endX="99"
android:endY="99"
android:startColor="#E364E5"
android:startX="0"
android:startY="0"
android:type="linear" />
</aapt:attr>
</path>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<size
android:width="100dp"
android:height="100dp" />
<gradient
android:endColor="@android:color/holo_red_light"
android:startColor="@android:color/holo_blue_light" />
</shape>
</item>
<item
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp">
<shape>
<solid android:color="@android:color/white" />
</shape>
</item>
</layer-list>