Navigation bar flashes black on performing popViewController

牧云@^-^@ 提交于 2019-12-12 19:07:11

问题


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.


回答1:


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];


来源:https://stackoverflow.com/questions/20521245/navigation-bar-flashes-black-on-performing-popviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!