Android 5.X SVG矢量动画机制——Android群英传
来源:互联网 发布:中国产业数据 编辑:程序博客网 时间:2024/05/19 17:49
SVG : Scalable Vector Graphics 可伸缩矢量图形
与Bitmap比较:Bitmap通过在每个像素点上存储色彩信息来表达图像,而SVG是个绘图标准,最大的优点就是放大不会失真,不需像Bitmap需要为不同分辨率设计多套图标。
<path>
标签 就像用指令的方式来控制一只画笔
常用指令:
L:绘制直线
M:移动
A:绘制弧线
SVG编辑器 编辑SVG图形 http://editor.method.ac/
Android中使用SVG
VectorDrawable 创建基于XML的静态的SVG图形,
<vector ..... <group ......> <path..../> `</group>` ./>
AnimatrdVectorDrawable 给VectorDrawable提供动画效果
<aniamted-vetor xmlns:android="http://schemas.android.com/apk/res/android"android:drawable="@drawable/vector"><target android:name="test" android:animation="@anim/anim_path1"/></animated-vector>对应的vector即为静态的VectorDrawable<vector xmlns:android="http://schemas.android.com/apk/res/android"android:height="200dp"android:width="200dp"android:viewporHeight="100"android:viewporWidth="100"> <group android:name="test" android:rotation="0"> <path android:strokeColor="@android:color/holo_blue_light" android:strokeWidth="2" android:pathData=" M 25 50 a 25,25 0 1,0 50,0"/> </group></vector>
AnimatedVectorDrwable中指定的target的name属性,必须和VectorDrawable中需要作用的name属性保持一致。target的animatoion属性,将一个动画作用到了对应的name的元素上,objectAnimator代码:
<objectAnimatorxmlns:android="http://schemas.android.com/apk/res/android" android:duration="4000" android:propertyName="rotation" android:valueFrom="0" android:valueTo="360"/>
设置给ImageView
<ImageView android:id="@+id/image" android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/anim_vector"/>
代码中:
((Animatable)imageView.getDeawable()).start();
0 0
- Android 5.X SVG矢量动画机制——Android群英传
- Android动画机制与使用技巧(五)——Android 5.X SVG 矢量动画机制
- Android 5.X SVG矢量动画案例
- Android SVG 矢量动画机制
- Android SVG矢量动画机制
- Android动画机制与使用技巧(四)Android 5.X SVG矢量动画机制
- android视图动画、属性动画、自定义动画、5.X SVG矢量动画机制详解
- Android 5.X SVG 矢量动画部分属性
- android SVG矢量动画
- 动画机制-《Android群英传》
- 群英传之Android 5.X过渡动画
- Android动画(4) 矢量动画SVG
- Android群英传学习笔记——动画机制
- Android使用SVG矢量动画(二)
- android群英传笔记 android动画机制
- Android群英传--动画机制与技巧(一)
- Android群英传笔记——第七章:Android动画机制和使用技巧
- Android群英传知识点回顾——第七章:Android动画机制与使用技巧
- Angular开发(十四)-利用angular的http转发、即代理http 请求,处理项目中请求跨域的问题
- Java网络通信之Socket编程
- VIM 配置 ctags
- Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)
- 认识端口与计算机入侵防范
- Android 5.X SVG矢量动画机制——Android群英传
- 将you are from shanghai 以shanghai from are you的形式输出
- 为什么每个人都这样匆忙?
- flex弹性布局
- linux简介
- 2.5>>迷宫
- java基础第一章_常量
- Oracle基本操作十一:游标
- 《数据压缩》实验报告四·DPCM编解码