Android:自动导入SVG [英] Android : automate SVG import

查看:624
本文介绍了Android:自动导入SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个旧版Android项目,在相应的可绘制文件夹中使用可绘制对象来实现mdpi,hdpi等.我们计划删除PNG文件并过渡到SVG.在此处中描述的SVG导入UI 从svg.有没有一种方法可以从命令行运行此工具,以便我们可以自动完成从SVG到Android Drawable.xml格式的转换.我们有很多文件,因此手动进行很繁琐. (或者,如果不可能的话,我将编写一个脚本来将SVG转换为Android Drawable.xml格式.如果已经存在这样的工具,将非常有帮助.)

We have a legacy Android project using drawables in the respective drawable folders for mdpi, hdpi, etc., We are planning to remove the PNG files and transition to SVG. The SVG Import UI described here creates the drawables xml from the svg. Is there a way to run this tool from command line so that we can automate the conversion from SVG to Android Drawable.xml format. We have a lot of files, so doing it manually is tedious. (Alternatively, if this is not possible, I will be writing a script to convert from SVG to Android Drawable.xml format. If such a tool already exists it will be very helpful.)

谢谢.

推荐答案

可在此处找到Android Studio的转换器代码:

The converter code from Android Studio can be found here:

提取它并将其转换为命令行实用程序应该相当容易.

It should be fairly easy to extract it and turn it into a command line utility.

这篇关于Android:自动导入SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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