Splash screen is stretching in Nexus 4

1.1k views Asked by At

I pasted my code below: problem is the image is stretching......

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".SplashScreen"
    android:background="@color/black" >

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:src="@drawable/splashscreen"/>

</RelativeLayout>
2

There are 2 answers

1
Praveen Sharma On BEST ANSWER

you should use 9 page image . You can generate 9-patch images from 9-path generator..

after that modify your imageView like as

<ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitCenter"
        android:src="@drawable/splashscreen"/>
1
Goran Horia Mihail On

Use wrap_content instead of match_parent:

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/splashscreen"/>