gpt4 book ai didi

iphone - iPad 上的自定义 UIView 动画过渡

转载 作者:行者123 更新时间:2023-12-03 19:40:27 24 4
gpt4 key购买 nike

我想知道是否有机会在 View 之间创建自定义过渡动画,作为“立方体”: http://www.pendrivelinux.com/wp-content/uploads/pdl-cubed.jpg

我看了一些例子,但没有成功,你知道一些,甚至可能吗?

谢谢

最佳答案

UIViewController* viewCtrl = [[UIViewController alloc] init];

CATransition *transition = [CATransition animation];
transition.duration = 1;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = @"cube"; //Note: undocumented API, will probably cause App Store rejection
transition.subtype = kCATransitionFromLeft;
transition.delegate = self;

[self.navigationController.view.layer addAnimation:transition forKey:nil];
self.navigationController.navigationBarHidden = NO;
[self.navigationController pushViewController:viewCtrl animated:YES];

[viewCtrl release];

关于iphone - iPad 上的自定义 UIView 动画过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4067608/

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