L'ajout d'un TabBarController que la sous-vue de Vue

Je suis le chargement d'un écran de démarrage de mon application démarre. Alors je veux charger un TabBarController et c'est ViewControllers. Cependant, mon TabBarController fenêtre n'est pas à l'échelle de la taille de l'écran.

Probablement 3/4 de la TabBar en bas, c'est se couper et Il y a une mince approximative de 20 pixels de l'écart en haut de l'écran en dessous de la barre d'état. Comment redimensionner la TabBarController correctement?

Voici le code dans mon SplashViewController chargement de la splash vue, et la TabBarController:

 -(void)loadView{
//Init the view
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
UIView *view = [[UIView alloc] initWithFrame:appFrame];
view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
self.view = view;
[view release];
splashImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Splash.png"]];
splashImageView.frame = CGRectMake(0,0,320,458);
[self.view addSubview:splashImageView];
viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController"  bundle:[NSBundle mainBundle]];
//viewController.view.bounds = [[UIScreen mainScreen]bounds];
viewController.title = @"Quiz";
viewController.tabBarItem.image = [UIImage imageNamed:@"puzzle.png"];
UIViewController *viewController2 = [[UIViewController alloc] initWithNibName:nil  bundle:nil];
viewController2.title = @"Nada";
viewController2.tabBarItem.image = [UIImage imageNamed:@"magnifying-glass.png"];
//viewController.view.alpha = 0.0;
//[self.view addSubview:viewController.view];
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:viewController, viewController2, nil];
[viewController2 release];
tabBarController.view.alpha = 0.0;
//tabBarController.tabBarItem.image = [UIImage imageNamed:@"State_California.png"];
//tabBarController.tabBarItem.title = @"State_California.png";
tabBarController.view.bounds = [[self view] bounds];
//tabBarController.view.frame = [[UIScreen mainScreen] applicationFrame];
[self.view addSubview:tabBarController.view];
timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(fadeScreen) userInfo:nil repeats:NO]; 
}
-(void) fadeScreen
{
[UIView beginAnimations:nil context:nil]; //begin animation block
[UIView setAnimationDuration:0.75]; //sets animation duration
[UIView setAnimationDelegate:self]; //sets the delegate for this block
[UIView setAnimationDidStopSelector:@selector(finishedFading)]; //Calls finishFading
self.view.alpha = 0.0; // //Fades the alpha to 0 over animation
[UIView commitAnimations]; //Commits this block, done
}
-(void) finishedFading
{
[UIView beginAnimations:nil context:nil]; //Begin animation block
[UIView setAnimationDuration:0.75]; //set duration
self.view.alpha = 1.0; //fades the view to 1.0 alpha over .75 seconds
//viewController.view.alpha = 1.0;
tabBarController.view.alpha = 1.0;
[UIView commitAnimations];
[splashImageView removeFromSuperview];
}

OriginalL'auteur Bryan | 2009-08-25