2

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
  • 3,185
  • 6
  • 28
  • 31

2 Answers2

2

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);
Dominik Hadl
  • 3,609
  • 3
  • 24
  • 58
  • 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?? – yassassin Mar 18 '12 at 06:36
  • 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 Mar 18 '12 at 08:27
  • 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. – Dominik Hadl Mar 18 '12 at 16:55
0

See my answer on Designing inside a scrollview in xcode 4.2 with storyboards.

Community
  • 1
  • 1
David
  • 9,635
  • 5
  • 62
  • 68