将我当前的项目图标转换为 Android 中的 Vector Drawables?

Convert my current project icons to the Vector Drawables in Android?

我是在 API level 21 中引入的 Android Vector Drawables 的新手。我想知道如何将 PNG 格式的现有项目图标转换为 SVG 文件 (Vector Drawables)?

如果您使用的是默认 Android 图标,您可以右键单击项目中的 "drawables" 文件夹,然后转到:新建 > 矢量资源。您可以在此处搜索所有 android 图标并将矢量资源(无论大小)添加到您的项目中。

如果您使用的是自定义图标,通常可以从您的编辑软件中将它们导出为 svg。如果没有,您可以 google 将图标转换为 svg/vector 可绘制对象转换器。

您可以像使用任何普通绘图一样使用矢量绘图。