Reputation: 3137
I want to implement a splash screen for my app, i'm using this code to show the image, but the image is centered and not stretched to the whole screen. How can i solve that problem? Thank you very much.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/splash"
android:id="@+id/splash"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ImageView>
</RelativeLayout>
Upvotes: 0
Views: 1416
Reputation: 17922
Try
<ImageView android:id="@+id/splash" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/splash"
android:scaleType="fitXY" />
Where android:scaleType="fitXY"
is responsible for stretching the image.
Upvotes: 4