Imageview One Dimension To Fit Free Space And Second Evaluate To Keep Aspect Ration
I need something like
for Android . I mean resize width to all available space (shrink or enlarge width of image) and automatically chang
Solution 1:
I found where is problem. Default implementation of ImageView can't enlarge image. If image is bigger than screen width android:adjustViewBounds="true" works correctly and adjust height to keep aspect ratio of image. But if image is smaller that screen width it don't upscale it.
This is cause by this code
if (newHeight <= heightSize) {
heightSize = newHeight;
}
in ImageView class (on line 688, API 10)
I made special child of ImageView which allow enlarge image to fit width.
Post a Comment for "Imageview One Dimension To Fit Free Space And Second Evaluate To Keep Aspect Ration"