VectorDrawable

来源:互联网 发布:知乎平均水平 编辑:程序博客网 时间:2024/05/23 13:03

这里总结三个标签的属性作用,这三个标签为:vertor、group、path

一、vector

1、android:name 定义该drawable的名字

2、android:widtn 定义该图片的宽度

3、android:height 定义该图片的高度

4、android:viewportWidth 将图片宽度分为viewportWidth份,用来表示坐标

5、android:viewportHeight 将图片高度分为viewportHeight份,用来表示坐标

6、android:alpha 该图片的透明度

二、group

1、android:name 定义该group的名字

2、android:pivotX 定义缩放或旋转该group时的旋转中心x坐标

3、android:pivotY 定义缩放或旋转该group时的旋转中心y坐标

4、android:rotation 定义该group的旋转角度,以x轴正方向为开始,顺时针旋转

5、android:scaleX 定义x轴的缩放倍数

6、android:scaleY 定义y轴的缩放倍数

7、android:translateX 定义x轴方向移动的距离

8、android:translateY 定义y轴方向移动的距离

三、path

1、android:name 定义该path的名字

2、android:pathData 定义绘图的路径信息,使用SVG指令

3、android:fillColor 定义绘图的颜色,并以该颜色填充图形

4、android:fillAlpha 定义绘制图形的透明度

5、android:strokeColor 定义绘图的颜色,只绘制边框

6、android:strokeWidth 定义绘图边框的宽度

7、android:strokeAlpha 定义绘图边框的透明度

8、android:strokeLineCap 定义路径线帽的形状,取值为 butt、round、square

9、android:strokeLineJoin 定义路径交界处的连接方式,取值为miter、round、bevel

10、android:trimPathStart 定义懂路径开始位置截断路径的比率

11、android:trimPathEnd 定义从路径结束位置截断路径的比率

原创粉丝点击