Android layer-list : bitmap issue with app:srcCompat
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" />
Instead of doing :
<item> <bitmap android:gravity="center" app:srcCompat="@drawable/login"> </bitmap></item>
You need to declare the background as follow:
<item android:gravity="center" app:srcCompat="@drawable/login"/>
Also, make sure that the element app schema
is presented:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> ....</layer-list>