Autorun width and scroll width tied to screen (not content)

I followed the number of examples (most of them are the same), for example https://www.youtube.com/watch?v=UnQsFlMGDsI

I open a new project, drop the scrollview inside, and then represent the "content" view, restricting the scroll view above it (top, bottom, left and right), then the Content view is limited inside the scrollview and then its width and height above the scroll list. Scrollview in red and black and white.

I drop the text box, and then snap it to the top, leading and ending the content view. Everything looks good in the storyboard, but when I run it, there is no view of the content, and the text field is the width of the objects in it (which are based on the text field).

No fixed content view height

Then I change the height of the content view as fixed 800, and now I can see the content view, but the width is fixed by the size of the text field (and not vice versa), that is, if I add more “Test information”, the text gets wider.

enter image description here

This is not my real project, but I just wanted to eliminate the reasons, so I did it from scratch, and it does the same. I don’t see what I am missing (hoping for a tick).

700, , , .

+4
1

, . . , (. ).

:

enter image description here

, scrollview , , .

enter image description here

, , UIView . , . , , , . : , , . , (.. Scrollview) (250). , ViewController, .

enter image description here

enter image description here

.

enter image description here

.

, , .

, - . (, , , ). , , , , . , :

enter image description here

, .

:

enter image description here

= ViewController, = , = , = .

, , . , .

+9

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


All Articles