Skip to content

Instantly share code, notes, and snippets.

@akueisara
Last active November 22, 2020 17:59
Show Gist options
  • Select an option

  • Save akueisara/7bc26636de4a66a0ddf5cafd787bea93 to your computer and use it in GitHub Desktop.

Select an option

Save akueisara/7bc26636de4a66a0ddf5cafd787bea93 to your computer and use it in GitHub Desktop.
Android - Add Support for Vector Drawables (SVG)

1. Enable the use of support library for vector drawables in build.gradle file (app level):

vectorDrawables.useSupportLibrary = true

2. Use app:srcCompat in the image tag in the layout file:

app:srcCompat="@drawable/svg_name"

3. You’ll also need to add the namespace to the root of the layout:

xmlns:app="http://schemas.android.com/apk/res-auto"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment