After updating to Studio 2.3 when i tried to create a layer list with a vector drawable it prompt to use app:srcCompat
instead of android:src
in bitmap
.
can any one help me to add vector drawable to layer list
?
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/colorWhite" /> <item> <bitmap android:gravity="center" app:srcCompat="@drawable/login"> </bitmap> </item> </layer-list>
Already added
vectorDrawables.useSupportLibrary = true
I found a solution for your problem
Modify second item to this:
<item android:gravity="center" android:drawable="@drawable/login"/>
UPDATE
this will cause crash on API < 21. There is not any better way.
I managed to do it the following way:
<item android:gravity="center" android:drawable="@drawable/login" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With