Navigation bar flashes black on performing popView

2019-07-15 12:29发布

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条回答
欢心
2楼-- · 2019-07-15 13:19

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];
查看更多
登录 后发表回答