Navigation bar flashes black on performing popViewController

1.4k views Asked by At

My app requires Pop animation in reverse direction.It's deployment target is IOS 7 only.

So ,I have implemented TRVSNavigationControllerTransition api.

I have default translucent navigation bar. It get popped successfully but flashed black at time of animation.

I have attached image of how actually it is being displayed.

Any help appreciated.

Thanks, Bazinga.enter image description here

1

There are 1 answers

0
Dhruv On BEST ANSWER

Okay so below is the solution I used to manage the situation .

To Push in reverse (i.e. from Left to Right)

CATransition *transition = [CATransition animation];
        transition.duration = 0.3;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
        transition.type = kCATransitionFromLeft;
        [transition setType:kCATransitionPush];
        transition.subtype = kCATransitionFromLeft;
        transition.delegate = self;
        [self.navigationController.view.layer addAnimation:transition forKey:nil];

        self.navigationController.navigationBarHidden = NO;
        [self.navigationController pushViewController:<objVC> animated:NO];

And , To Pop in reverse (i.e. from Right to Left)

CATransition *transition = [CATransition animation];
        transition.duration = 0.3;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
        transition.type = kCATransitionFromRight;
        [transition setType:kCATransitionPush];
        transition.subtype = kCATransitionFromRight;
        transition.delegate = self;
        [self.navigationController.view.layer addAnimation:transition forKey:nil];

        self.navigationController.navigationBarHidden = NO;
        [self.navigationController popViewControllerAnimated:NO];