0

This is my code:

<ImageView
    android:id="@+id/imagen"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:scaleType="centerInside"
    android:src="@drawable/ig" >

</ImageView>

And works well in portrait mode for some devices. But in landscape the image does not scale up to the width of the parent. The same occurs in portrait when resolution is too high like in nexus 10 tablet. I read about the system prevents the image to be bigger than screen, so height seem to be limitated by this fact, but i have a scrollview and this is not important for me. How can i do this?

Thanks!

borja
  • 125
  • 9
  • with centerInside the image will only be scaled to fit inside the imageView. And if You go to landscape it scales to shortest side, too. Without seeing more code it is difficult to say, bit if Your ImageView is inside a ScrollView, make width and height to match_parent and remove scaleType. – Opiatefuchs Aug 07 '13 at 13:04
  • see http://stackoverflow.com/questions/2991110/android-how-to-stretch-an-image-to-the-screen-width-while-maintaining-aspect-ra – Guy Oct 22 '13 at 12:01

0 Answers0