自Segue公司与UIViewAnimationOptionTransitionCurlDown [英] Custom Segue with UIViewAnimationOptionTransitionCurlDown

查看:360
本文介绍了自Segue公司与UIViewAnimationOptionTransitionCurlDown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义SEGUE交换ViewControllers与卷曲起来的动画,但我不能找到一种方法,会是什么? - (无效)此执行

I'd like create a custom segue to swap ViewControllers with a curl up animation but I can't find a way, What would be the -(void)perform for this?

我这有

-(void)perform{
    UIViewController *dst = [self destinationViewController];
    UIViewController *src = [self sourceViewController];    
    [UIView beginAnimations:nil context:nil];
    //change to set the time
    [UIView setAnimationDuration:1];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:src.view    cache:YES];
    [UIView commitAnimations];
}

但我没有得到改变的观点,反正感谢您的帮助!

But I don't get to change the view, anyway thanks for your help!

推荐答案

没关系,我解决了,备案我不得不这样做的唯一的事情就是添加一个导航控制器,然后我可以使用自定义塞格斯,如:

Nevermind, I solved it, for the record the only thing I had to do was add a Navigation Controller and then I could use custom segues like:

- (void) perform {
    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;
    [UIView transitionWithView:src.navigationController.view duration:0.3
                       options:UIViewAnimationOptionTransitionFlipFromBottom
                    animations:^{
                        [src.navigationController pushViewController:dst animated:NO];
                    }
                    completion:NULL];
}

这篇关于自Segue公司与UIViewAnimationOptionTransitionCurlDown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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