Skip to content

Instantly share code, notes, and snippets.

@anilkumar416
Created September 24, 2019 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anilkumar416/8b037660b630d330bc7010adea0123f2 to your computer and use it in GitHub Desktop.
Save anilkumar416/8b037660b630d330bc7010adea0123f2 to your computer and use it in GitHub Desktop.
How to use vector images in android studio ?
1. In build.gradle (Module:app)
Inside the defaultConfig
add --> vectorDrawables.useSupportLibrary(true)
2.Add this field in the xml file
xmlns:app="http://schemas.android.com/apk/res-auto"
3.Now you can replace your src with srcCompact
app:srcCompat="@drawable/image_name"
Vector images are very small in size
They don't lose quality when you scale them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment