I have a modal view, which I show after application launch. The problem now is that the Modal view leaves 20 pixels for the status bar (See picture)
double status bar http://k.minus.com/j1vKSpCmFJXie.png
This is what my MyViewController looks like in Interface builder:
IB-Layout http://k.minus.com/jbyZPICtsq0sMy.png
In the viewDidLoadcallback I set the view to my WelcomeVC’s view like this:
- (void)viewDidLoad{
[super viewDidLoad];
self.view = self.navController.view; // navController is the outlet to my NavigationController in IB
}
I open the modal like this:
MyViewController *welcomeVC = [[MyViewController alloc]init];
[self presentModalViewController:welcomeVC animated:YES];
[welcomeVC release];
How do I get rid of this space between the view and the status bar?
I figured out that it does not make a lot of sense to add the NavigationController directly to the viewcontroller, since the NavigationController should rather be defined outside the ViewController, since my ViewController does not neccesarily know whether it will be displayed inside a NavigationController or a modal popup or maybe even a Popover on an iPad.
So what I’ve done is I created two separate ViewControllers for both the
Welcome viewand thePlans view. This means that they are more universally usable also for cases when only either of the views is displayed.