Using vector images on android studio

Vector illustration, I have always known this thing, but I can't do it myself, I can only use it. It would be better if there are colleagues who can do it, so that the app can be thinner.

It doesn't matter if you can't make vector graphics, there are libraries, such as Ali's father's iconfont+ , but I only know this one that is easy to use.

Go to the home page and choose a picture to download, remember to choose SVG download

After downloading, select the drawable folder in your project, right-click->New->Vector Asset

Select Local file (SVG, PSD), then select the .svg file you just downloaded, then click Next and Finish

In this way, a .xml file is generated in the drawable folder, which is the vector diagram we want to use

see the effect

ImageView imageView = findViewById(R.id.image_view);
imageView.setImageResource(R.drawable.ic_smile);

Can

share an article

5 Ways to Convert Bitmap to Vector Quickly丨Tools





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325805527&siteId=291194637