How to scale UIImage view square with Autolayout inside UIScrollView

I'm struggling to learn autorun (finally). I want to have a vertical scrollable UIScrollView that contains all the content for the view. I want to bind the UIImage view to the top of the scrollview and keep the image square (scaleToFill). Basically I want to do this (only I want to do this with autorun):

enter image description here

I can’t get the image to keep its aspect ratio, staying within the screen. Whenever I add a restriction on the format, the imageView grows to 600 points (the width is png, I think), but I want it to be as wide as possible than the screen.

, UIImageView, , scrollView imageViw , , , , . scrollView.

:

enter image description here

4 / 0.

+1
1

UIScrollView , UIImageView .

UIImageView . UIImageView, UIScrollView, , .

Placeholder Interface Builder.

, .

0

Source: https://habr.com/ru/post/1622795/


All Articles