Placing content in scrolling mode with a storyboard longer than the screen

How do I make my UIScrollview big enough in the storyboard so that I can add all the content I need? The amount of content I'm adding is longer vertically than the iPhone screen, but the storyboard won't let me detach the scroll from the view controller so I can stretch it vertically and add all my required content.

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

To paraphrase: I want to put a lot of things in my scrollview using the interface builder, the iPhone rectangles to create the interface do not allow me to add items to the end of the virtual screen, I use a scroll because I need to add things to the end of the regular iPhone screen. For example, in Android development, when you run out of vertical space as a scroll in layout.xml, the scroll view takes longer so you can add more stuff, is there a way to do this in a storyboard?

+4


source to share


3 answers


@AlexFritz: This is because you are not setting the contentSize on the scrollView. When you're done setting your routines to the UIScrollView, you can return the UIViewController's frame to its original size. And use this screenshot to set the ScrollView contentSize.

Set ScrollView's Content Size



Be aware to select scroll before setting this property from the interface constructor.

Greetings.

0


source


I had the same issue in Xcode 10 storyboard. I was able to solve this problem by selecting the ViewController in the storyboard and then selecting the size inspector. It shows simulated size ...

I changed the simulated size to arbitrary and then changed the height to 1000 (or whatever size you want) to lengthen the view controller displayed in the storyboard.



Not aware of runtime problems. I am guessing that I may need to change the simulated size back to a fixed one with the original size.

0


source


You don't need to make your scroll size large while maintaining your scroll view. Size as is, subject to performance. Add a label as a peek in the ScrollView, then increase its height enough to contain all the text. and just set the offset of the scroll content big enough to place the label

-1


source







All Articles