It has how to configure an image in ImageView so that it takes the whole screen of the mobile

1

The following declare normal to ImageView :

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/imagem"/>

but the image does not fill the entire screen.

    
asked by anonymous 27.01.2015 / 12:44

2 answers

6

Try adding the following property:

android:scaleType="fitXY"

However, depending on your image, it may not keep the same quality and aspect ratio, so you have to use a good image for it.

    
27.01.2015 / 12:57
2

First, use MATCH_PARENT when you want your View to occupy all the screen space. The FILL_PARENT property has been deprecated from API 8.

Take a look at the android:adjustViewBounds parameter to make your ImageView resize itself to fit your resized image.

Then you can change the way your image is resized by using the android:scaleType parameter, here you can see the properties that best suit you.

    
27.01.2015 / 13:05