OStack程序员社区-中国程序员成长平台

标题: ios - 执行 popViewController 时导航栏闪烁黑色 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 17:08
标题: ios - 执行 popViewController 时导航栏闪烁黑色

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

所以,我已经实现了TRVSNavigationControllerTransition接口(interface)。

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

我附上了实际显示方式的图片。

任何帮助表示赞赏。

谢谢, 巴津加。 enter image description here



Best Answer-推荐答案


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

反向推(即从左到右)

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 (即从右到左)

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

关于ios - 执行 popViewController 时导航栏闪烁黑色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20521245/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4