什么是使用在Android SVG图标最佳做法? [英] What are best practices for using SVG icons on Android?

查看:342
本文介绍了什么是使用在Android SVG图标最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创造我的第一个Android 本地(所以不是基于浏览器的)应用程序,并寻找有关图标创建/调配一些好的做法。 由于它应该支持多种设备/分辨率我认为这是最好使用SVG来创建它们。至少有这个lib目录下: HTTP://$c$c.google.com/p/svg-安卓/ ,承诺提供支持SVG在Android上。

I am about to create my first Android native (so not browser based) app and looking for some good practices regarding icon creating/provisioning. Since it should support multiple devices/resolutions I thought it is best to use SVG to create them. There is at least this lib: http://code.google.com/p/svg-android/ that promises to offer support for SVG on Android.

描述的这种用法或其他库来渲染SVG图标在设备上的一种手段,迄今为止,我还没有找到资源,让我有点不情愿使用它。我迄今所看到的最好的是使用SVG为pre-渲染PNG在不同分辨率下基于图标的源文件格式。

So far, I have not found resources describing the usage of this or another library as a means to render SVG Icons on the device, so I am a bit reluctant in using it. The best I have seen so far is using SVG as the source format for pre-rendering png based icons in different resolutions.

所以我的问题是:是否SVG图标一个很好的选择,在设备上直接使用未经PNG pre-渲染步骤(它在所有的工作),如果,为什么没人似乎用这种方式?

So my questions is: Are SVG icons a good option to use directly on the device without a png pre-rendering step (does it work at all), and if, why does nobody seem to use this approach?

推荐答案

有关Android的年纪比棒棒堂,对SVG在Android上的最佳实践将是使用工具将SVG转换成PNG的大小(S)你有兴趣,现有的Andr​​oid的支持SVG是不是COM prehensive什么,你很可能会发现在一个SVG文件,即使它是,支撑不内置的操作系统,所以使用它们直接图标是肯定的。

For Android older than Lollipop, your best practice for SVG on Android is going to be to use a tool to convert your SVG to PNG at the size(s) you're interested in. Existing SVG support for Android is not comprehensive of what you're likely to find in an SVG file, and even if it were, the support is not built into the OS so using them directly for icons is definitely out.

棒棒糖(API 21)参见<一个开始href="http://stackoverflow.com/questions/9647770/what-are-best-practices-for-using-svg-icons-on-android/29229005#29229005">What是使用在Android SVG图标最佳做法?。感谢@MarkWhitaker @AustynMahoney指出了这一点。

Beginning with Lollipop (API 21) see What are best practices for using SVG icons on Android?. Thanks to @MarkWhitaker @AustynMahoney for pointing this out.

这篇关于什么是使用在Android SVG图标最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆