我想创建一个自定义 Segue 来用卷曲动画交换 ViewController,但我找不到方法,-(void) 执行此操作会是什么?
我有这个
-(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];
}
但我无法改变观点,无论如何感谢您的帮助!
没关系,我解决了这个问题,根据记录,我唯一要做的就是添加一个导航控制器,然后我可以使用自定义转场,例如:
- (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];
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)