How to open an image inside an Imageview in its original size?

Asked

Viewed 194 times

2

I have some images within imageView, and I needed to open these images in the original size when I click on them. Does anyone know how to do that? Thanks in advance.

  • What do you mean, "open up"?

  • click on it.

  • You click and then? How will you present it?

  • I thought I had class ready Android to handle this, but I’ll have to take the clicked Imageview and send to an Activity with a great layout.

  • I do it myself, open on an Activity just to display the image.

  • and to zoom in on the image? how do you do? I’m looking for it now.

Show 1 more comment

2 answers

3


Place this property in your Imageview

android:scaleType="center"

Information about Scaletype.

  • the "CENTER_INSIDE" worked as I needed, but vlw

  • @daniel12345smith CENTER_INSIDE does not display the image with the original size, it resizes it to the dimensions of the Imageview

  • Yes, but as I put imageView inside a screen size layout it was the same as using "wrap_content". But thanks for the tip

2

The attributes defined in Imageview is that will determine the size of the image.
How it is displayed, resized (Scaled) or cut will depend on the attribute android:scaleType.

However, when you want to display it in the original size the attributes that define the length and width should be declared as wrap_content

android:layout_width="wrap_content"
android:layout_height="wrap_content"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.