Ludwig Arcache
Ludwig Arcache

Reputation: 37

Create full screen image on Android to fill the splash screen

I'm new to Android programming, trying to create a splash screen with image. Currently I have this code :

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">

<item>
    <bitmap
        android:src="@drawable/splash"
        android:gravity="fill"/>
</item>

</layer-list>

This result I get is a centered image with empty space top and bottom.

I tried multiple constants like center, fill, fill _horizontal, etc.. Also tried to replace bitmap with ImageView, but I think I need some more knowledge how to propely use it.

I'm trying to make the image fill the screen like this :

enter image description here

Upvotes: 0

Views: 866

Answers (1)

Ludwig Arcache
Ludwig Arcache

Reputation: 37

I used android:dither="true" for bitmap, code like this :

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">

<item>
    <bitmap
        android:src="@drawable/splash"
        android:dither="true"

        />
</item>

</layer-list>

Upvotes: 1

Related Questions