gpt4 book ai didi

iphone - UINavigationController:相反方向的弹出 View Controller

转载 作者:可可西里 更新时间:2023-11-01 04:05:14 26 4
gpt4 key购买 nike

我正在尝试调用 [[self navigationController] popViewControllerAnimated:YES] 但使动画从右向左而不是从左向右滑动。有什么简单的方法可以做到这一点吗?我想回到之前的 View 。任何帮助表示赞赏。谢谢!

最佳答案

这就是如何在相反的方向弹出 View Controller 。它对我 100% 有效

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

关于iphone - UINavigationController:相反方向的弹出 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8030930/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com