我想像这样在 View Controller 之间创建过渡。
https://www.dropbox.com/s/qatwqaq2mowocsg/Transitions%20Controller.gif?dl=0
我已使用以下代码创建过渡,但无法实现以下结果。
self.settings = [self.storyboard instantiateViewControllerWithIdentifier"settings"];
CATransition* transition = [CATransition animation];
transition.duration = 0.4;
transition.type = kCATransitionPush;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
transition.subtype=kCATransitionFromRight;
[[self navigationController].view.layer addAnimation:transition forKey:kCATransition];
[[self navigationController] pushViewController:self.settings animated:NO];
Best Answer-推荐答案 strong>
你可以试试这个代码:
self.settings = [self.storyboard instantiateViewControllerWithIdentifier"settings"];
[UIView beginAnimations"View Flip" context:nil];
[UIView setAnimationDuration:0.80];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:
UIViewAnimationTransitionFlipFromRight
forView:self.navigationController.view cache:NO];
[self.navigationController pushViewController:self.settings animated:YES];
[UIView commitAnimations];
关于ios - 在 View Controller 之间转换时自定义动画,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/32710102/
|