Why are Views loaded from nibs being placed 20 pixels down from the status bar?

Posted by rickharrison on Stack Overflow See other posts from Stack Overflow or by rickharrison
Published on 2010-03-31T20:05:33Z Indexed on 2010/04/01 1:13 UTC
Read the original article Hit count: 337

I am trying to set up a layout as such in an iPad application. It will have three major views, which make up the whole screen. The views will be stacked one on top of the other, each taking up the full width. I have one major nib file which accounts for the entire screen space. In that nib file, I am instantiating the three view controllers with outlets. Then I have this code:

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.view addSubview:controllerOne.view];
    [self.view addSubview:controllerTwo.view];
    [self.view addSubview:controllerThree.view];
}

This adds the views on top of one another and 20 pixels lower. However, after rotating to landscape and back they are right under the status bar. Do you know what would be causing this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ipad