2010-09-06 102 views
0

我想知道是否有人使用CATRANSITION从顶部管理pagecurl。我有以下几种:CATransition页面顶部卷曲

CATransition *animation = [CATransition animation]; 
[animation setDelegate:self]; 
[animation setDuration:0.35]; 
[animation setTimingFunction:UIViewAnimationCurveEaseInOut]; 
animation.type = @"pageCurl"; 

animation.subtype = kCATransitionFromTop; 

animation.fillMode = kCAFillModeForwards; 

animation.endProgress = 0.30; 
[animation setRemovedOnCompletion:NO]; 
[self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"]; 

但不幸的是,它总是从底部卷曲页面。如果有人能告诉我如何从顶部卷曲页面,我将非常感激。

非常感谢。

回答

1

找到答案,需要从右侧设置子类型!

1
subtype = KCATransitionFromLeft or KCATransitionFromRight 

如果您想要卷页页面的全部动画,您还可以删除animation.endProgress。 =)

1

我有这个工作。你需要设置animation.type = @“pageUnCurl”; - 谁曾想到!谢谢苹果。

CATransition *animation = [CATransition animation]; 
[animation setDelegate:self]; 
[animation setDuration:0.5]; 
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 
animation.type = @"pageUnCurl"; 

animation.subtype = kCATransitionFromTop; 
animation.fillMode = kCAFillModeForwards; 
animation.startProgress = 0.3; 
[animation setRemovedOnCompletion:NO]; 

[self.helpView.layer addAnimation:animation forKey:@"pageCurlAnimation"];