2

Currently i m using Android AQuery and displaying it and its working fine. but i m having an issue that if image that is returned from Web server is not of same size as that of image container then it does not fit to the container. I have used the following piece of code of Aqery

mAquery.id(Thmbnail).auth(handle).image(DetailData.get(Position).getImageURL(),true,true,0,0,null,0,mAquery.RATIO_PRESERVE);

If I use

mAquery.RATIO_PRESERV

then images become of weird size and if i use ration then it results crop image does any one here have any idea about this that it won`t crop the image and use the container size of image view Thank you in advance for help

Usman Kurd
  • 7,212
  • 7
  • 57
  • 86

2 Answers2

2

Seems like you want to stretch the image?

In that case just use fitXY scale type in the xml layout of ImageView and use ratio of 0.

Peter Liu
  • 180
  • 1
  • 5
  • The question is how to preserve aspect ratio and the image view not cropping the image. With your solution, as you say the image will stretch and it doesn't preserve the aspect ratio. So it doesn't answer the question. – User Feb 14 '14 at 17:07
-1

This should solve your problem:

AQuery.FADE_IN

mAquery.id(Thmbnail).auth(handle).image(DetailData.get(Position).getImageURL(),true,true,0,0,null,mAquery.RATIO_PRESERVE, AQuery.FADE_IN);
MrEngineer13
  • 38,642
  • 13
  • 74
  • 93
Ara Badalyan
  • 1,616
  • 1
  • 15
  • 20