UPDATE
I have posted another solution here which I think is simpler and better.
ORIGINAL
Here's another way to do this that you might like better:
- Set the File's Owner placeholder's custom class to your view controller subclass.
- Create the
UIScrollView
as a top-level object in your nib. Set its size to the screen size (320x460) or just turn on a status bar under "Simulated Metrics". - Connect the scroll view's
delegate
outlet to File's Owner. - Set the File's Owner's
view
outlet to the scroll view. - Create a
UIView
as another top-level object in your nib. This will be your content view. - Set the content view's size to 320x700.
- Create a strong (or retain, if not using ARC) outlet named
contentView
in your view controller (File's Owner) and connect it to the content view. - Put your buttons in the content view.
-
In your view controller's
viewDidLoad
, do this:- (void)viewDidLoad { [super viewDidLoad]; [self.view addSubview:self.contentView]; ((UIScrollView *)self.view).contentSize = self.contentView.frame.size; }
-
In your view controller's
viewDidUnload
, do this:- (void)viewDidUnload { self.contentView = nil; [super viewDidUnload]; }
UIViewController
should resize it to be full-screen anyway. – rob mayoff Feb 2 '12 at 20:39