I want an image to completely occupy the background of the entire screen and for this I use the main attribute background
The RelativeLayout
corresponding layout
to Activity
is the following:
<?xml version="1.0" encoding="utf-8"?>
<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"
android:background="@drawable/fondoinicio"
tools:context="com.kirolm.kmibilbideaklezo.MainActivity"
android:paddingBottom="@dimen/activity_vertical_margin">
</RelativeLayout>
As can be seen in the following screenshot, there is a vertical white line to the right of the screen that I cannot eliminate. The capture is made in preview
the Android Studio
. Specifically of a Nexus 5X with a screen of 1080x1920: 420 dpi
, but the same happens with the different devices that it offersAndroid Studio
I save the image in different densities. These are the data:
- hdpi(564x1001)
- mdpi (376x667)
- xhdpi (752x1334)
- xxhdpi (1128x2001)
- xxxhdpi (1504x2668)
One option would be to add the image inside an ImageView
and use the property:
either
The problem was in the image. The images were exported in different densities in
Sketch
, usingplugin
Sketch Android assets
and apparently thisplugin
has an error. Adds a vertical line the size of apixel
which is only visible when selecting the image.Attached image with a lot of zoom to appreciate the error in the export.
Using another export plugin the problem has been solved.