gpt4 book ai didi

objective-c - 用于弹出 View 的自定义 Storyboard Segue?

转载 作者:太空狗 更新时间:2023-10-30 03:55:22 25 4
gpt4 key购买 nike

我的 Storyboard中有一个 UINavigationController 设置,我制作了一个自定义的 segue 类,您可以在下面看到它在我的 View 之间很好地淡出(而不是沼泽标准推送)。

但是,当我点击我的导航 Controller 给我的那个后退按钮时,我得到了一个我不想要的推送动画,我想使用那个淡入淡出!我也不想在我的 Storyboard 中有两个方向的 segue,因为它只会变得困惑。

自定义淡入淡出:

-(void)perform
{
__block UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
__block UIViewController *destinationController = (UIViewController*)[self destinationViewController];

[UIView transitionWithView:sourceViewController.navigationController.view duration:1.0 options:UIViewAnimationOptionTransitionCrossDissolve
animations:^
{
[sourceViewController.navigationController pushViewController:destinationController animated:NO];
}
completion:^(BOOL finished)
{
NSLog(@"Transition Completed");
}];
}

编辑

也许我应该简化一下。我如何在 UINavigationController 中的两个 View Controller 之间执行交叉淡入淡出,而不是标准的左右动画?

最佳答案

如果您正在为 iOS 7 构建您可以使用 UINavigationControllerDelegate 和新的 View Controller 转换 api。

这是一个指南: http://www.captechconsulting.com/blog/tyler-tillage/ios-7-tutorial-series-custom-navigation-transitions-more

关于objective-c - 用于弹出 View 的自定义 Storyboard Segue?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12201032/

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