2

I've got an image loaded from Parse.com and on xhdpi and xxhdpi devices, the image displayed is very tiny. I've tried playing with the XML layout. The most I can do is to stretch a background image that is the border for the downloaded image to full width of the screen. The height of the image never exceeds the physical size of the image stored on parse.

I'm trying to get the image to scale to fit the width of any device its on, while maintaining the aspect ratio.

I'm using a ParseImageView which is a subclass of ImageView. I accomplished this on iOS by resizing the image to fill the width, and then setting ImageView.contentMode=UIViewContentModeScaleAspectFit; Is there any equivilant to this for Android?

ac74xc
  • 21
  • 2

1 Answers1

0

You can achieve this by using Picasso Library. Using Picasso Library, you can get the width and height of the image from Web by casting it to Bitmap and scaling the ImageView to that aspect ratio. Related post is below:

getting image width and height with picasso library

Community
  • 1
  • 1