Android studio 将 svg 转为 xml
Android如何加载SVG格式的矢量图
为何要加载SVG图片
相对于.JPG和.PNG甚至.webp的图片来说,SVG的图片有两个优点,第一:省空间,APK瘦身有一个方面就是从图片瘦身,使用SVG图片可以大量减轻程序的大小。第二:省时间,切放大缩小适配各种机型图片不会改变。
如何在androidstudio中使用SVG图片呢?
首先,你需要有SVG图片,你可以网络下载 推荐几个不错的图标制作下载网站:
阿里icon:http://www.iconfont.cn/plus
图标制作:http://romannurik.github.io/AndroidAssetStudio/
图标制作2:http://jaqen.me/mdpub/
然后下载到电脑。:

下载好的SVG图标
在这儿用我们的android编程软件,使用GOOGLE官方提供的类VectorDrawable来加载SVG图片。
步骤一:File-new -Vector Asset

步骤一
步骤二:
出来界面

你可以自己在这里制作Materical Icon
点击android机器人图标弹出:

可以选择现有图标制作
如何加载我们下载好的图片:

选择Local file 还可以加载psd文件

选择我们下载好的桌面SVG格式文件,右边预览效果
至此 你就可以使用SVG图片在你的应用中了。
相关推荐
mapaler 2020-07-17
MIKUScallion 2020-07-05
Dickzeng 2020-07-05
wallowyou 2020-06-28
hermanncain 2020-06-25
mapaler 2020-06-21
Dickzeng 2020-06-17
程序员俱乐部 2020-06-11
lanzhusiyu 2020-06-09
hermanncain 2020-05-09
Elena0 2020-04-11
Leonwey 2020-04-11
wallowyou 2020-03-05
jinxiutong 2020-02-10
jinxiutong 2020-02-03
mqbeauty 2020-01-08
mapaler 2020-01-17
Elena0 2020-01-12
mapaler 2020-01-05