Hello Android learners in this tutorial, you are going to learn to add Vector icons in the drawable folder of the Android project. So that later we can use those icons in ImageView or for any other purpose.
Follow the given steps to add Vactor icons.
Step1
Right-click on the res folder and go to new > Vector Asset
Step2
When you will click on VectorAsset, a new small window will open so choose the
- Clip art
- Size
- Name of the clipart
Step3
Click Finish
Now clipart or icon is added successfully!
You will find it on res > drawable
How to use it?
To use clipart with ImageView, use srcCompat attribute.
app:srcCompat="@drawable/icon_name" Output
So in this way, you can add Vector icons in Android Studio.
Read more..
Roadmap to become Android Developer
0 Comments