Skip to content
sofina edited this page Feb 3, 2017 · 11 revisions

Vector Drawable

####什么是Vector Drawable: 1, 它不会因为图像的缩放而失真。在安卓开发中也就意味着你不需要为不同分辨率的设备定义不同大小的图片资源;

2,可以减小包大小,同样一张图,用vector实现,大小仅为png图片的十分之一;

3,功能强大,所有复杂的动画都不需要用java代码实现,只需要在xml文件里编辑即可;

vector drawable 存在兼容性问题,具体的兼容方案请参考: Android Vector曲折的兼容之路 如果你的android studio 版本是1.4以上的,并且使用的设备是android 5.0以上,那么恭喜你,你可以忽略上述兼容方案了

####如何生成一个vector 资源? 方式一,用android studio提供的现成的资源

首先在drawable目录下new 一个vector 对象 选择

####怎么用Vector Drawable做一个简单的动画??

Clone this wiki locally