gpt4 book ai didi

iphone - 是否可以在属于不同 UIViewController 的 2 个 View 之间进行转换?

转载 作者:行者123 更新时间:2023-12-03 21:08:48 25 4
gpt4 key购买 nike

我使用 navigationController 来推送和弹出 2 个 View Controller 。但我希望在 2 个 View Controller 的 View 之间以 5 秒的间隔进行过渡(就像 CATransition 淡入淡出一样)。可能吗?

欢迎大家留言

谢谢

交互开发

最佳答案

您可以像这样使用CATransition:

CATransition* transition = [CATransition animation];
transition.duration = 5.0;
transition.type = kCATransitionFade;

[self.navigationController.view.layer addAnimation:transition
forKey:kCATransition];

[self.navigationController pushViewController:self.alternateView
animated:NO];

关于iphone - 是否可以在属于不同 UIViewController 的 2 个 View 之间进行转换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4747201/

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