开发者

Table view shifts down when using a UINavigationController

开发者 https://www.devze.com 2023-02-19 07:03 出处:网络
So various iterations of this question seems to have been asked on this site multiple times, but none of them seem to 开发者_C百科apply to my situation.So I\'ve got a login screen that flips to a navi

So various iterations of this question seems to have been asked on this site multiple times, but none of them seem to 开发者_C百科apply to my situation. So I've got a login screen that flips to a navigation controller upon successful login. When it flips to the navigation view, the navigation bar is all the way at the top, and then shifts down once the animation is complete. This does not create an odd white space above the navigation bar, because the navigation bar is starting embedded in the status bar during the animation. I have checked that both view controllers in question have the status bar enabled, so I'm not sure what I need to do to fix this strange problem.

Here is how I am switching the views

-(void) swapToNavController
{    
    [UIView beginAnimations:@"View Flip" context:nil];
    [UIView setAnimationDuration:1.25];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

    UIViewController *coming = nil;
    UIViewController *going = nil;
    UIViewAnimationTransition transition;

    coming = eventsNavController;
    going = viewController;
    transition = UIViewAnimationTransitionFlipFromRight;

    [UIView setAnimationTransition: transition forView:self.window cache:YES];
    [coming viewWillAppear:YES];
    [going viewWillDisappear:YES];
    [going.view removeFromSuperview];
    [self.window insertSubview: coming.view atIndex:0];
    [going viewDidDisappear:YES];
    [coming viewDidAppear:YES];

    [UIView commitAnimations];
}


I was able to resolve this issue by switching the method I used to perform the animations as seen in this post

0

精彩评论

暂无评论...
验证码 换一张
取 消