Search code examples
iphoneinterface-builderuiscrollviewxcode4

Scrolling through UIScrollView in Interface Builder for Xcode 4


This seems to me as though it would be a common problem, but I can't seem to find the answer anywhere. This question seems to address the issue, but I can't seem to get the solution to work and I'm not sure it's referring to Xcode 4.

When using Interface Builder in Xcode 4 and working with a UIScrollView, is there a way to scroll the view down in Interface Builder itself to view/add/edit controls that are out of the viewable section of the screen? I've managed to push a couple controls down using the arrow keys, but now I can't see them and therefore can't manipulate them in Interface Builder. Scrolling the view in IB would be first prize, but if there's a way to even select the controls using a drop-down menu or whatever so I can push them back up with the arrow keys, that would at least be something. Thanks.


Solution

  • Just a workaround which helps in Xcode4:

    1. Expand the Objects Panel which resides on the left of the Interface Builder view (there is the tiny arrow at the bottom of the panel).
    2. Drag your UIScrollView from the view hierachy and place it on the top level.
    3. Now you can resize it to access more content (scrolling to that content did not work for me).
    4. When you are done adding child views to the scrollview, you need to resize it back to be smaller or the same size as the parent view.
    5. After your changes you would need to put back the scroll view where it belongs in your hierachy