gpt4 book ai didi

ios - Xcode Segue View Controller 从右到左没有 UINavigation

转载 作者:行者123 更新时间:2023-11-28 21:32:47 31 4
gpt4 key购买 nike

我想将我的 View Controller 从右向左过渡(就像导航 Controller 所做的那样)但是没有嵌入 UINavigationController。我正在使用 Xcode 7,标准的 Segue 似乎没有这个选项。非常欢迎任何指导!!!

最佳答案

如果你想成为黑客,你可以这样做:

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];

[self presentModalViewController:viewCtrl animated:NO];

您真的应该只使用导航 Controller 或编写自定义过渡动画,请参阅 here对于一个制作您想要的动画的项目。

let transition = CATransition()
transition.duration = 0.3
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight

self.view.window?.layer.addAnimation(transition,forKey:nil)
self.presentViewController(viewCtrl, animated: false, completion: nil)

如果你在 Swift 中需要它。

关于ios - Xcode Segue View Controller 从右到左没有 UINavigation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35236207/

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