0

I'm trying to create a ScrollView (inside a TabBar) containing a bunch of Views, some of which are off the end of the initial screen in the NIB editor.

How do I place the Views below the visible part of the screen in the editor?

Thanks!

Paul Kinzelman
  • 547
  • 1
  • 7
  • 22

3 Answers3

1

You just need to make the size of the scrollview and subview larger in IB so that you can place items outside of the normal viewing area. Make sure you set the contentsize properly in your viewcontroller code.

See this post for a little more clarificaion

Community
  • 1
  • 1
Dan F
  • 17,654
  • 5
  • 72
  • 110
  • I looked at the 'post' and don't understand how to do this - right now I have nothing in code, I'm trying to place all the views. Are you saying I need to set contentSize someplace (where) in my code and that will affect the NIB editor? – Paul Kinzelman Nov 20 '11 at 15:45
1

Put your ScrollView out of its view container if there is one (take it from the explorer on the left). Now you can manipulate the scroll view, disable the "status bar" preview, and any other preview bar of that kind in the right panel.

You can now fully resize your scrollview. Make it big, put the view somewhere in a corner, then resize your scrollview so the view is no more visible.

Then put back the scrollView in its container if you had put it out before, and set back all preview styles.

Oliver
  • 23,072
  • 33
  • 138
  • 230
  • I can't seem to grab the ScrollView (inside a Tab View Controller) and move it anywhere. Right now I have the hierarchy: Tab Bar Controller | FirstViewController | ScrollView | bunch-of-TextFields. The ScrollView doesn't seem to move. Or does something need to be set in code? As I mentioned in the below comment, I have nothing in code yet. – Paul Kinzelman Nov 20 '11 at 15:48
  • @PaulKinzelman:If you have a scrollView, you put it there, so you should be able to put it somewhere else... – Oliver Nov 20 '11 at 20:36
0

FOR FUTURE GOOGLERS :

I finally found a solution to this seemingly idiotic problem from apple : You can't scroll your scroll view in Interface Builder.

The remedy in xcode 4 is : 1. Go to the ruler menu on the right 2. Go to the View item 3. Set a height quite large like a 1000 4. Set the Y value to a negative value like -250

Playing around with a negative value for Y will allow you to see offscreen part of your scrollview !!

Yahel
  • 8,522
  • 2
  • 24
  • 32