Leo.Han Leo.Han - 3 months ago 8
iOS Question

How to make iOS ImageView full match window?

enter image description here

I am new in iOS , I am an android developer self-learing iOS just for fun.
As you can see from the picture , I want to make my ImageView full-displayed in the window in different inch iPhone.
If you are an android developer, you may know what I mean is how to make ImageView match_parent in both width and height?
Thank you very much for your answer.

Answer

You must set the UIImageView Constraints, like this to adjust in the full screen, 0 spacing in all sizes, and click in Add 4 Constraints

enter image description here

After that, you must check in the UIImageView settings the mode to Aspect Fit, so it will keep the aspect ratio of your image.

I Took the image from your print, here is the expected final result.

enter image description here