Scaling not working as expected #921
Unanswered
LudoFarkas
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You should set the scale type on the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Hi,
I'm migrating from Glide to Coil and have an issue with image scaling. I'm used to set the scale type in code. So in order to achieve
ImageView.ScaleType = CENTER_CROP
I setscale(Scale.FILL)
. The problem is that the image does not fill theImageView
, but fits entirely in. However, if the scale type is set in xml, it works as expected.Expected behavior
I would like to get a clear explanation of how Coil's scale should work in case I don't understand it right. Or to have it corrected in case there is a bug.
To Reproduce
I have 2
ImageView
s in a layout with blue background to highlight their borders (one of them without explicitly set scale type, the second set tocenterCrop
). The expected behavior is to achieve filling both of theImageView
s:The same image is loaded to them in code:
Only the second image fills the
ImageView
, see screenshots.Logs/Screenshots
Version
1.3.2
Beta Was this translation helpful? Give feedback.
All reactions