s.s.
s.s.

Reputation: 71

custom wrap_content in ImageView

I have a problem with ImageView on example 1. the width is fix-310dp and height is wrap_content. And when users load picture (e.g 1920x2560) in ImageView from their gallery it should be as an example 2. On which way to solve this problem?

image view example

Upvotes: 0

Views: 60

Answers (1)

WarrenFaith
WarrenFaith

Reputation: 57702

Try to use the attribute android:adjustViewBounds="true" on your ImageView.

Update:

You need to set the scaleType to matrix and after that call setImageMatrix() with your matrix as a parameter.

mImageView.setScaleType(ImageView.ScaleType.MATRIX);
mImageView.setImageMatrix(myMatrix);

Upvotes: 1

Related Questions