Is there a way to embed a UIView in a UIScrollview without losing the limitations of subviews in iOS?

I have too many subviews in my ContentView, and now I want this contentView in UIScrollview, but if I do, I will lose all the limitations of the subview. Editor-> Paste in UIScrollview does not work.

Can I embed ContentView in a UIScrollView? thank

+4
source share
3 answers

Just select your controls, now go to Editor-> EmbedIn-> View

+2
source

Incorrect unswer. but fixed by selecting ContentView

Editor-> Paste in → Scroll Page

Xcode . " ". .

+1

, , , /xib, " " > " " ( "Ctrl" ) XML , view scrollView. , "Open as" > "Interface Builder", .

Note that the restrictions at the top and bottom of the view are used by default in the top and bottom layouts of the manual, but if you want to scroll, you need to use the top or bottom space to represent the container (scroll view). You can do this by clicking the option when creating constraints.

+1
source

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


All Articles