Aspect fill and Aspect fit swift

2.4k views Asked by At

I am trying to create a news feed with a title, description and image. I am using auto layout and I can't correctly auto resize my image (i.e. width, that fills all screen and resizable height, that keeps ratio of original image).

I found a solution using "Aspect fit" mode for image view, but a big blank space is a real problem sometimes:

I searched everywhere, and didn't find a solution to this problem.

Another option is tp use "Aspect fill" mode, but it doesn't show the whole picture:

I can't believe it is impossible to resize an image and show it on screen with specific constraints, without blank spaces.

1

There are 1 answers

0
Gee Kay On

I guess you may want to re-align both the text and the Image View so that the Guidelines just fit below the Navigation Bar.

Try ctrl+ Click and drag and drop over the text. I don't have a clear idea to guide you. But I guess this should work.