简体   繁体   English

Android矢量Drawables VR PNG

[英]Android vector drawables vrs png

Having doubts about this. 对此有疑问。 I know that vector drawables have the scaling advantage. 我知道矢量可绘制对象具有缩放优势。 But before i start making all my new icons in this way, is there any good reason to stick with the good old Pngs? 但是在我开始以这种方式制作所有新图标之前,是否有充分的理由坚持使用旧Png? I would really appreciate a good advice on this. 我真的很感谢在此方面的好建议。

But before i start making all my new icons in this way, is there any good reason to stick with the good old Pngs? 但是在我开始以这种方式制作所有新图标之前,是否有充分的理由坚持使用旧Png?

if providing only one version of your drawable instead than 3 or 4 scaled versions is not enough a good reason, then you can stick with drawables. 如果仅提供一个版本的可绘制对象而不是3或4个缩放版本是一个很好的理由,那么您可以坚持使用可绘制对象。 Be aware that VectorDrawable are supported from lollipop onwards. 请注意,棒棒糖开始支持VectorDrawable For the platforms between ICS and Lollipop, the gradle plugin ( 1.5.0 ) creates a raster versions, of your vector drawable. 对于ICS和Lollipop之间的平台,gradle插件( 1.5.0 )创建矢量可绘制的光栅版本。 You can specify the density you want to export adding 您可以指定要导出的密度

 generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

to the defaultConfig section of your build.gradle . build.gradledefaultConfig部分。

Edit 编辑

As point out by @Huteri, the support library v23.2 makes it easier to use it, adding support-vector-drawable and animated-vector-drawable . 正如@Huteri所指出的那样, support library v23.2使其更易于使用,添加了support-vector-drawablesupport library v23.2 animated-vector-drawable Have a look here 在这里看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM