CATransition 从顶部卷曲页面

发布于 2024-09-18 02:01:14 字数 575 浏览 12 评论 0原文

我想知道是否有人使用 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"];

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

非常感谢。

I wanted to know if anyone managed a pagecurl from the top using the CATRANSITION. I have the following :

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

but unfortunately, it always does the page curl from the bottom. I will be very grateful if anyone can tell me how to do a page curl from the top.

Many thanks.

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

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

发布评论

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

评论(3

忆梦 2024-09-25 02:01:14

我已经做到了这一点。您需要设置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"];

I've got this working. You need to set animation.type = @"pageUnCurl"; - who would have thought! Thanks apple.

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"];
血之狂魔 2024-09-25 02:01:14

找到答案了,需要将子类型设置为从右开始!

Found the answer, need to set subtype to from right!

2024-09-25 02:01:14
subtype = KCATransitionFromLeft or KCATransitionFromRight 

如果你想要卷曲页面的完整动画,你也可以删除animation.endProgress。
=)

subtype = KCATransitionFromLeft or KCATransitionFromRight 

you can also remove the animation.endProgress if you want a total animation of curl page .
=)

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