Question Detail

Background is horizontally stretched in android studio, how to get rid from this.

Here's My code Please Help:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/splash_bg_white"
    android:orientation="vertical">


Thread Reply

Anonymous

- 9 months ago

You are using RelativeLayout and want to add background image of That RelativeLayout.

Your background will stretch to you mobile Screen or your RelativeLayouts height width.

For ignoring that stretch effect from your background image use imageView in the RelativeLayout and 

<RelativeLayout

Height...

Width....

>

<ImageView

Android:scaletype:cropcenter\>

<\RelativeLayout>

And remove your background line from your relative layout.