Alex Kraev
Alex Kraev

Reputation: 222

How to add scrolling to uiviewcontroller?

Good day! I have view controller in storyboard, its height more than default size and it is not scrolling. how to make it so? i tried to add uiscrollview to uiview but it didn't help. thanks for answering=)

Upvotes: 1

Views: 2971

Answers (2)

Alex Kraev
Alex Kraev

Reputation: 222

found the solution: for correct working scrolling you need ONLY add constraint horizontal and vertical spaces + spaces from top and bottom Layout guide=) stay on scroll view - touch button "Add missing constraints"... after this constraints will be added automatically...=) setting contentSize or frame is not necessary! good luck!

Upvotes: 0

Patrick Goley
Patrick Goley

Reputation: 5417

UIScrollView is exactly what you need, however scrolling will only be possible if the contentSize of the scroll view is larger than the bounds of the scroll view itself. Try setting the contentSize of the scroll view either in storyboard or pragmatically.

Upvotes: 1

Related Questions