如何更改ViewController之间的Segue速度 [英] How to change speed of segue between ViewControllers

查看:60
本文介绍了如何更改ViewController之间的Segue速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以控制搜寻速度吗?

我已经检查了文档,但Apple没有给定方法.

但是我更多地是在寻找可以破解和更改较低级别代码以进行慢动作搜寻的想法.

解决方案

下面的代码具有自定义功能,您可以在代码中设置过渡的持续时间.

 -(无效)执行{UIViewController * src =(UIViewController *)self.sourceViewController;UIViewController * dst =(UIViewController *)self.destinationViewController;[UIView transitionFromView:src.viewtoView:dst.view持续时间:3.0选项:UIViewAnimationOptionTransitionFlipFromLeft完成:NULL];} 

示例项目在GitHub中: https://github.com/weed/p120805_CustomSegue

您可以下载并运行它.希望对您有帮助.

Is it possible to control segue speed?

I have checked the documentation but there is no given method by Apple.

But I am more looking for ideas to hack in and change lower level code to make segueing in slow motion.

解决方案

Below code is of custom segue, and you can set duration of transition in code.

- (void)perform 
{
    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;
    [UIView transitionFromView:src.view
                        toView:dst.view
                      duration:3.0
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    completion:NULL];

}

Sample project is here in GitHub:https://github.com/weed/p120805_CustomSegue

You can download and just run it. I wish this is help for you.

这篇关于如何更改ViewController之间的Segue速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆