在iPad上自定义UIView动画转换

时间:2010-11-01 08:58:55

标签: iphone ipad uiview uiviewanimation

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

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

由于

2 个答案:

答案 0 :(得分:4)

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];

答案 1 :(得分:1)

应该可以。您需要拥有2个视图和一些Core Animation 3D变换。