Last active
June 12, 2020 12:09
-
-
Save iniyanmurugavel/9beb8ec71363873cc831ca338fae882a to your computer and use it in GitHub Desktop.
Vector Support Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaultConfig { | |
| vectorDrawables.useSupportLibrary = true | |
| } | |
| onCreate () | |
| AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); | |
| For all xml views in which you are setting a vector drawable replace | |
| android:src | |
| with | |
| app:srcCompat | |
| and in the code replace this: | |
| imageView.setImageResource(...); | |
| I implemented ‘AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);’ in the Activity with ‘vectorDrawables.useSupportLibrary = true’ on API Level 23.4.0, however VectorDrawables still crashes the app on pre-Lollipop devices. | |
| Hopefully AppCompat will fix this in the next library release. Very much looking forward to saving a ton of time with VectorDrawables. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaultConfig { | |
| vectorDrawables.useSupportLibrary = true | |
| } | |
| onCreate () | |
| AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); | |
| For all xml views in which you are setting a vector drawable replace | |
| android:src | |
| with | |
| app:srcCompat | |
| and in the code replace this: | |
| imageView.setImageResource(...); | |
| I implemented ‘AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);’ in the Activity with ‘vectorDrawables.useSupportLibrary = true’ on API Level 23.4.0, however VectorDrawables still crashes the app on pre-Lollipop devices. | |
| Hopefully AppCompat will fix this in the next library release. Very much looking forward to saving a ton of time with VectorDrawables. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment