Answer the question
In order to leave comments, you need to log in
How to dynamically resize an ImageView?
Good afternoon, I have a ListView with Pictures as elements.
I would like the image to stretch across the width of the screen (this can be done), and scaled in length automatically. Tried fill_parent + CenterCrop doesn't work very well.
There are also elements consisting of TextView, when scrolling text and image elements, the value of the slider changes. Is it possible to make it permanent? Thanks a lot!!!
Answer the question
In order to leave comments, you need to log in
If I understand correctly, then approximately:
Bitmap tmpBitmap = (Bitmap) your picture;
Bitmap resizedBitmap = Bitmap.createScaledBitmap(tmpBitmap, newWidth, newHeight, false);
Width and height will have to be calculated in advance, of course.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question