I can’t figure out how to use ScrollView together with autolayauts. I found tricks in some lessons - it is necessary that inside the scroll view there was a container view in which all elements will be stored, and also it is necessary to tie the width of this container to the general view. I kind of did it.
In my general View, a ScrollView is inserted, by constraints it is completely stuck to the edges. Inside the ScrollView is inserted a View, which is glued to the boundaries of the ScrollView. I also linked the general View and the internal View by the EqualsWidth constraint. And it seems that when it starts up everything works, if you pull the view, it will scroll. But if you scroll slightly down, then not all elements fall into view. Some of the elements remain below the screen. It is also an interesting fact that if you pull up a view, all these elements are shown completely on the screen (those that you couldn’t get before), but if you release it, it bounces back downwards.
Top items are shown perfectly. I also tried to set the height of the content for the scrollView from the code:
override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) self.scrollview.contentSize.height = 1500 } I first inserted it into viewDidLoad, it did not produce a result, then in viewWillAppear, but also no result. Advise what to do?
The red line I marked the level by which the content scrolls, the elements do not intercept below this line. 