Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Putting content in scroll view using storyboard that is longer than length of screen

How do I make my UIScrollview big enough in storyboard so that I can adda all the content I need to it? The amount of content I am adding is longer vertically than an iPhone screen, but storyboard will not let me detach the scroll view from the view controller so that I can extend it vertically and add all my required content.

How do I extend the scrollview vertically in storyboard so that I can add all the content I need to add to it?

Rephrasing: I want to put a lot of things in my scrollview, using interface builder, The interface builder iPhone rectangles do not allow me to add things below the end of the virtual screen, I am using a scroll view because I need to add things below the end of a regular iPhone screen. For example, in Android development, when you run out of vertical space on a scroll view in the layout.xml, the scroll view gets longer so yo can add more things, is there a way to do a similar thing in storyboard?

like image 267
ChristianCuevas Avatar asked Nov 23 '22 15:11

ChristianCuevas


1 Answers

I had the same problem in the Xcode 10 storyboard. I was able to solve the problem by selecting the ViewController in Storyboard, and then selecting the Size Inspector. It shows the Simulated Size...

I changed the Simulated Size to Freeform, and then changed the Height to 1000 (or whatever size you need it to be) to elongate the View Controller displayed in the Storyboard.

Don't know about runtime issues. I'm assuming I might need to change the Simulated Size back to Fixed with the original size.

like image 140
Michelle Avatar answered Jun 26 '23 14:06

Michelle