UITableView Navigation Bar "Flickers" on Animation

629 views Asked by At

I have a UIViewController, a "switcher" that will basically just rotate a view from one to another.

It all works great, except that the view that I am transitioning to is a UIViewController which holds a UITableViewController. For some reason, when the animation "flips", the navigation bar is invisible, and once the animation completes the navigation bar just appears.

It really doesn't look good and I was wondering if anyone knew why I might be seeing this and how I could fix it?

Thanks,

--d

EDIT: Adding some code by request!

Switcher viewDidLoad method - Currently Initializing both of the ViewControllers because I thought it may help

[super viewDidLoad];

LogoView *logoController = [[LogoView alloc] init];
self.logoView = logoController;
[self.view insertSubview:logoView.view atIndex:0];
[logoController release];

MainController *vController = [[MainController alloc] init];
self.controller = vController;
[vController release];

    switchTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(switchViews) userInfo:nil repeats:NO];

Switcher switchViews method

[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

if (self.controller.view.superview == nil)
{
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
    [controller viewWillAppear:YES];
    [logoView viewWillDisappear:YES];

    [logoView.view removeFromSuperview];
    [self.view insertSubview:controller.view atIndex:0];
    [logoView viewDidDisappear:YES];
    [controller viewDidAppear:YES];
}

[UIView commitAnimations];

MainController viewDidLoad method

CGRect frame = CGRectMake(0, 0, 320, 410);

FirstLevelController *controller = [[FirstLevelController alloc] init];

navController = [[UINavigationController alloc] initWithRootViewController:controller];
navController.view.frame = frame;
navController.navigationBar.tintColor = [UIColor blackColor];

[controller release];

[self.view addSubview:navController.view];

Inside the FirstLevelController I just add the items to the table view... I've tried adding a navController.title = @"Home", but I am not even seeing the black navbar without text... it's just a big empty space.

Help is muchly appreciated!

1

There are 1 answers

0
dewberry On BEST ANSWER

Hah! I changed the animation "cache" from YES to NO, and it fixed it! Yay!