0

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>
Tim
  • 11,710
  • 4
  • 42
  • 43
Mubarak
  • 1,419
  • 15
  • 22

2 Answers2

0

Use wrap_content instead of match_parent:

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/splashscreen"/>
Goran Horia Mihail
  • 3,536
  • 2
  • 29
  • 40
0

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"/>
Praveen Sharma
  • 4,326
  • 5
  • 25
  • 45