Member-only story

How to the Mode property UIImageView iOS

Mr.Javed Multani
4 min readNov 2, 2019

--

The content mode property of a view tells how its content should be laid out. In the Interface Builder, the various modes can be selected in the Attributes Inspector.

Let’s use two image views to see how the various modes work.

Scale to Fill

The image heights and widths are stretched to match the size of the UIImageView.

Aspect Fit

The longest side (either height or width) of the image is stretched to match the view. This makes the image as big as possible while still showing the entire image and not distorting the height or width. (I set the UIImageView background to blue so that its size is clear.)

Aspect Fill

--

--

Mr.Javed Multani
Mr.Javed Multani

Written by Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer

No responses yet