Reputation: 69
I am creating a game.
At the moment, for my splash screen, I use an image.
The problem is it stretches.
How do I prevent that?
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="hitesh.asimplegame.SplashScrean"
android:background="@drawable/mulalo">
Upvotes: 3
Views: 10006
Reputation: 9121
Always use Imageview for displaying the image.
Sample xml for splash screen
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_bg"
android:scaleType="centerCrop"
/>
</RelativeLayout>
Replace your image with splash_bg.
NOTE : As question with less information I am assuming that you are using only one image for the splash screen.
Upvotes: 11