I want all of my images in a specific Image View to fit in a 16:9 aspect ratio. The image should resize to fit itself into those contraints without changing its own aspect ratio.
So for example, if I have an image with an aspect ratio of 4:3, it should resize itself, while keeping its aspect ratio, to the Image View's contraints of 16:9.
So my question is, using the interface builder, how do I set an Image View to have a 16:9 aspect ratio?
Steps:
If you change the width constraint, the height will automatically change respecting the aspect ratio. Make sure you set your ImageView
's content mode to be scaleAspectFill
.