Reputation: 6948
I using the drawable resource splash_screen.xml
as my splash screen's icon, but the android:width and android:height require the min API 23, how to fix with it?
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary"/>
<item
android:width="300dp"
android:height="300dp"
android:drawable="@mipmap/splash_icon"
android:gravity="center" />
</layer-list>
Upvotes: 1
Views: 838
Reputation: 71
this is what i am using,
on res/drawable/splash_screen.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" />
<item>
<bitmap
android:gravity="center"
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp"
android:src="@drawable/bg_splash_logo" />
</item>
</layer-list>
and on res/drawable-v23/splash_screen.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" />
<item
android:bottom="10dp"
android:drawable="@drawable/bg_splash_logo"
android:gravity="center"
android:left="10dp"
android:right="10dp"
android:top="10dp"/>
</layer-list>
Upvotes: 2
Reputation: 1
For lower API levels, specifying width and height directly is impossible. you can only scale your icon
Upvotes: 0