I have an image view, declared programmatically, and I am setting its image, also programmatically.
However, I find myself unable to set the image to both fit the aspect and align centre to the image view.
In other words, I want the image to:
- Scale down to fit the aspect, if the image is large.
- Centre but not scale up, if the image is small.
How do I get that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…