jeudi 2 avril 2015

Android Resize images according to the screen size of the device

I hope someone can help me. I have days looking for a way to Resize images in android according to the screen size of the device. Sometimes the picture is fine but when used in a slightly larger image comes to be very small and not resized or adapted to the screen size.


For there I saw that for every image that wanted to join the project, was to add image in different sizes, Example: 80x80, 160x160,220x220,320xx320 (each has the same name.) and that helped resized.


Or did so but not me. sometimes the image is totally distorted.


This is the code I use for ImageView



<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/inicio"
android:background="@drawable/inicio1"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:layout_below="@+id/imageView"


/>


that I can do to make the image take an appropriate size according to the size of the screen.


Thank You


Aucun commentaire:

Enregistrer un commentaire