Implementing a UIScrollView with Storyboard

12,050

I think you want to set the conentSize height to 644. The iPhone screen is 480, so you can't display anything larger, but the content size can be bigger, so it will scroll. Something like this...

scrollView.contentSize = CGSizeMake(320, 640);
Share:
12,050
yassassin
Author by

yassassin

Updated on June 04, 2022

Comments

  • yassassin
    yassassin almost 2 years

    I'm getting crazy in implementing a ScrollView within Storyboard. I have a container View and above it I've put a ScrollView higher than the View. The height of the View and the ScrollView is set through the SizeInspector (and not with scripting):

    View ScrollView

    The problem is that I cannot drag a ScrollView on the workspace (as with InterfaceBuilder), but only within the View itself. So if my ScrollView is higher (644) than the container View (411), I cannot see the entire ScrollView and put above it my textfields.

    How can I solve this problem? Any help is appreciated!

    Thanks in advance, yassa

  • yassassin
    yassassin about 12 years
    yes, but... If i want to put my textfield on the scrollview, what I've to do? The only way is programmatically?! With IB it was possible, with the Storyboard??
  • Dominik Hadl
    Dominik Hadl about 12 years
    It should work if you normally dragged the text view onto the scroll view and set up its position in Interface Builder or programmatically.
  • Dominik Hadl
    Dominik Hadl about 12 years
    You won't see the entire content of the scroll view in the IB. If you need to see it do this - set the content size to 320x1280, enable paging and in Simulator scroll to the second screen.