在Android中使用SVG的最简单方法? [英] Easiest way to use SVG in Android?

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

问题描述

我发现了许多库,以便在Android中使用svg并避免令人沮丧的创建不同分辨率并为每个分辨率删除文件的情况,当应用程序包含许多图标或图像时,这将变得非常烦人.

I have found a myriad of libraries in order to use svg in Android and avoid the frustrating creation of different resolutions and dropping files for each resolution, this becomes very annoying when the app has many icons or images.

任何人都可以对使用最简单的库进行逐步介绍,以便在Android中使用SVG.我敢肯定,这也会对其他许多人有所帮助.

Can anyone be as kind to give a step by step process of the simplest to use library for using SVG in Android, I'm sure this will help many others too.

我还使用Android Studio和Illustrator生成图标和图像.

Also I use Android Studio and Illustrator for generating my icons and images.

推荐答案

首先,您需要按照以下简单步骤导入svg文件.

First you need to import svg files by following simple steps.

  1. 右键单击可绘制对象
  2. 点击新建
  3. 选择向量资产

如果计算机中有图像 然后选择本地svg文件. 之后,选择图像路径 如果需要,还可以在对话框的右侧使用更改图像大小的选项. 以这种方式将svg图像导入到您的项目中 之后,使用此图像使用相同的步骤

If image is available in your computer then select local svg file. After that select the image path and an option to change the size of the image is also available at the right side of dialog if you want to . in this way svg image is imported in your project After that for using this image use the same procedure

@drawable/yourimagename

这篇关于在Android中使用SVG的最简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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