0

I have an ImageView that is too big for my screen. I want it to start on the left side and continue outside of screen.

Right now I use

scaleType = "centerCrop"

but it's not what I want.

Right now I have

enter image description here

But what I want is

enter image description here

Any clue for me? Thanks

Edit Here's what it does with fitStart:

enter image description here

dequec64
  • 923
  • 1
  • 8
  • 26

2 Answers2

1

I've been able to do what I wanted with the use of matrix.

I reused the code from that answer:

https://stackoverflow.com/a/6333518/5749193

But instead of going with the width, I went with the height to calculate the scaleFactor.

Hope it might help someone else!

Community
  • 1
  • 1
dequec64
  • 923
  • 1
  • 8
  • 26
0

You might want to use

scaleType = "fitStart"

see https://developer.android.com/reference/android/widget/ImageView.ScaleType.html

EDIT

Maybe set adjustViewBounds = true https://developer.android.com/reference/android/widget/ImageView.html#attr_android:adjustViewBounds

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
SnyersK
  • 1,296
  • 8
  • 23