0

I am transitioning from one view to another using UIViewAnimationOptionTransitionCrossDisolve.

The issue I am having is, after the transition takes effect, I have a 20 pixel gap at the top of my screen, and the new UIViewController pushes up so the screen looks normal.

How do I fix this?

Here is my transition code:

- (IBAction)logInButtonTapped
{
    [self performTransition:UIViewAnimationOptionTransitionCrossDissolve];
}

-(void)performTransition:(UIViewAnimationOptions)options
{
    //Step 1:  Create your Controllers
    _frontViewController = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]];
    NSLog(@"ViewController Frame: %@", NSStringFromCGRect(_frontViewController.view.frame));
    _frontViewController.wantsFullScreenLayout = NO;
    self.navigationController.navigationBar.frame = CGRectOffset(self.navigationController.navigationBar.frame, 0.0, -20.0);
    UIViewController * leftViewController = [[LeftSideViewController alloc] init];

    //Step 2:  Instantiate your PKRevealController
    self.revealController = [PKRevealController revealControllerWithFrontViewController:_frontViewController leftViewController:leftViewController rightViewController:nil options:nil];

    UIView * fromView, *toView;

    if ([self.view superview] != nil)
    {
        fromView = self.view;

        toView = self.revealController.view;

        NSLog(@"After Transition ViewController Frame: %@", NSStringFromCGRect(_frontViewController.view.frame));
    }

    [UIView transitionFromView:fromView toView:toView duration:0.5
                       options:options completion:^(BOOL finished){}];
}

Here is what my NSLog's show:

2013-04-03 18:14:30.560 AppName[24631:c07] {{0, 0}, {320, 548}}
2013-04-03 18:14:31.691 AppName[24631:c07] ViewController Frame: {{0, 0}, {320, 568}}
2013-04-03 18:14:31.692 AppName[24631:c07] After Transition ViewController Frame: {{0, 0}, {320, 548}}
Luke Irvin
  • 1,179
  • 1
  • 20
  • 39

1 Answers1

0

I fixed my issue. I had to set the wantsFullScreenLayout equal to YES.

Luke Irvin
  • 1,179
  • 1
  • 20
  • 39