Android : What to use for width/height in layerlist items for Android API less than 21

424 views Asked by At

I've created a splash screen, with an image that resizes well on API >=21, but gets broken below than version.

Following is the xml.

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <color android:color="#4F9FFB"/>
    </item>
    <item
        android:width="70dp"
        android:height="70dp"
        android:drawable="@drawable/logo"
        android:gravity="center">
    </item>
</layer-list>

Breaks because android:width="70dp" and android:height="70dp" are not supported below 21.

What's the alternative for this?

0

There are 0 answers