Yesterday, I\'ve switched to Android Studio version 2.1.3. Today, I\'ve re-opened one of my projects and tried to add some layer-list drawables for use with an ImageVi
First of all, I'd like to thank @pskink for helping me to analyse the problem :)
The xml in the question worked for API level 23+, because
it is possible to set width and height right within the "item" tag
like @android developer states in this SO post
It did not work for lower versions, because there one needs to set width and height attributes for a ShapeDrawable using the size tag.
I suppose Android needs the size to figure out how to scale the drawable (-> aspect ratio!) while taking into account the insets (top, left, right, bottom).
And as is sometimes the case with malformed (for a specific API level) xml, Android failed silently and simply did not draw the shape.
So the solution is:
-
-