How to setup a view in Interface Builder that is taller than 480 pixels.
This will be done using two xib files:
MainView.xib is the view for MainViewController, it is 460 pixels tall.
TallView.xib is a 600 pixel tall view (see below for how to do this in IB).
MainViewController only contains a UIScrollView. All your content should be in TallView.xib
In MainViewController, override viewDidLoad and use the following code:
viewDidLoad:
- (void)viewDidLoad {
//load your TallView.xib into a UIView object
NSArray *nibParts = [[NSBundle mainBundle] loadNibNamed:@"TallView"
owner:nil
options:nil];
//first object is the view
UIView *tallView = [nibParts objectAtIndex:0];
//add tallView to scrollView
[scrollView addSubview:tallView];
//set content size to same dimensions as TallView.xib
scrollView.contentSize = CGSizeMake(320, 600);
}
How to create a view taller than 480 pixels in Interface Builder
Override the height of a xib beyond 480 by first setting the simulated interface elements to "none", and then change the height.
See two screen shots: