Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Library about override Resource

If I create a Library and add normal drawable int drawable-xxhdpi, then add Resource file with the same name at the app.the app's Reasource will replace the library's Resource, just like:

enter image description here

But if I use the svg resource,It won't replace the library's Resource,like:

enter image description here

How to replace the vector drawable?

like image 608
cs x Avatar asked Oct 25 '16 15:10

cs x


1 Answers

During the build, vector drawables from the library are placed in the drawable-anydpi-v21 folder.

Since this will take precedent on all v21+ devices, you need to move your app drawable to the same folder if you want it to override the library resource.

For pre-v21, you need to set vectorDrawables.useSupportLibrary = true on the library and the app, and place the vector drawable in the drawable folder.

like image 109
tachyonflux Avatar answered Sep 24 '22 17:09

tachyonflux