My wine app has more fields on the data entry page than will fit on the iPhone's screen, so I decided to put the controls inside a UIScrollView. I had trouble finding good examples of such oversized data entry pages, so I mostly experimented in Interface Builder.
The first step is to increase the size of the main view so that it's large enough to accommodate full page. This can be done just by dragging the standard resize control on the lower right corner of the view window. As noted previously, this can't be done unless all the Simulated User Interface Elements (in the View Attributes) are set to "None".
The next step is to drag in a UIScrollView control from the Library. Make it the same size as the main view. Drag all labels, text fields, etc. to this scroll view; note that the controls appear under Scroll View in the main window when viewed hierarchically.
The next step is to resize the main view and the scroll view to the size of the iPhone screen. First shrink the scroll view to smallish box in the upper left corner of the main view. Then shrink the main window back to standard size; a fast way to do this is to turn back on one or more of the Simulated Interface Elements. Finally, expand the scroll view so that it fills the main view.
There is one more step that I finally figured out after banging my head against the wall for a few hours (I found the lead
here). For some reason, the scroll view will not scroll unless it's explicitly told that its content -- the collection of fields and other controls -- is bigger than its visible area. This must be done in code.
First, add a UIScrollView property to the view controller class. As with other view properties, this means 4 lines of code:
1. Adding an instance variable of type UIScrollView to the header:
UIScrollView *scrollView;
2. Adding a property directive for that instance variable to the header:
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;
3. Adding a synthesize directive for the property to the implementation file:
4. Adding a release of the property to the dealloc method's implementation.
Next use Interface Builder to map the scroll view property to the actual UIScrollView control. This means right clicking on the File Owner and dragging from the new property's little circle to the scroll view.
Now the scroll view object can be accessed in code by referencing the new property. What's left is to set the scroll view's contentSize property to the full size of the scroll view. I did this from the view controller's viewDidLoad event:
[scrollView setContentSize: CGSizeMake(320, 640)];
You might have to experiment to determine what size is best for your scroll view.