导航栏在执行popViewController时闪烁黑色

时间:2013-12-11 14:05:51

标签: ios ios7 uinavigationbar popviewcontroller

我的应用需要反向弹出动画。它的部署目标只有IOS 7

所以,我已经实现了TRVSNavigationControllerTransition api。

我有默认的半透明导航栏。 它成功弹出但在动画时闪现黑色。

我附上了实际显示效果的图像。

任何帮助表示感谢。

谢谢, Bazinga。enter image description here

1 个答案:

答案 0 :(得分:1)

好的,以下是我用来管理情况的解决方案。

推进反向(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];

并且,反向弹出(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];