Background image on Android App

0

I want to put a background image, in fact I put it but it does not respect the proportion and it is very long. As the dimensions of mobile devices are very varied, I would like the image is not deformed and cut where the screen ends because the size is higher (1920x1080).

And that's how my layout starts: (background is background.png, the background).

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:background="@drawable/background"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Inicio">

How do you advise me to do it?

    
asked by Antonio Ruiz 25.04.2018 в 19:41
source

1 answer

0

I auto answered.

I created a separate xml:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/background"
    android:tileMode="disabled" android:gravity="top" >
</bitmap>

And it is this xml that I put in the background of the layout and ready: p

    
answered by 25.04.2018 в 20:03