iPad 上的自定义 UIViewAnimationTransition

发布于 2024-09-29 21:54:35 字数 240 浏览 3 评论 0原文

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

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

谢谢

I'm wondering if there is any chance to create a custom transition animation between Views, as a "cube":
http://www.pendrivelinux.com/wp-content/uploads/pdl-cubed.jpg

I've took a look for some example, without any success, do you know some, is even possible?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满意归宿 2024-10-06 21:54:35
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];
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];
梦中楼上月下 2024-10-06 21:54:35

这应该是可能的。您将需要有 2 个视图和一些核心动画 3D 转换。

It should be possible. You will need to have 2 views and a bit of Core Animation 3D transforms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文