PageTurn动画iPhone [英] PageTurn animation in iPhone

查看:127
本文介绍了PageTurn动画iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让翻页动画像诗节的应用程序?

此前我使用,但它不是动画我期待的。

  [CATransaction开始]。
   CATransition *动画= [CATransition动画]   [动画的setType($ P $ @ pvPagepageUnCurl:@页面卷曲广告素材?);   [动画setDuration:0.7f];
   [动画setFillMode:(prevPage kCAFillModeBackwards:kCAFillModeForwards?)];
   [动画setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
   [自层] addAnimation:动画forKey:@transitionViewAnimation];
   [CATransaction提交]

感谢


解决方案

  [UIView的beginAnimations:@yourAnim背景:无];
[UIView的setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView缓存:cacheFlag];
...
[UIView的commitAnimations];

本页面是否卷曲动画。对于翻盖,使用 UIViewAnimationTransitionFlipFromLeft UIViewAnimationTransitionFlipFromRight 不变。

How to make page turn animation like the Stanza app ?

Earlier i was using , but its not the animation i am looking for.

   [CATransaction begin];
   CATransition *animation = [CATransition animation];

   [animation setType:(prevPage ? @"pageUnCurl" : @"pageCurl")];

   [animation setDuration:0.7f];
   [animation setFillMode: ( prevPage ? kCAFillModeBackwards : kCAFillModeForwards )];
   [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
   [[self layer] addAnimation:animation forKey:@"transitionViewAnimation"];
   [CATransaction commit];

Thanks

解决方案

[UIView beginAnimations:@"yourAnim" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag];
...
[UIView commitAnimations];

This does the page curl animation. For the flip, use the UIViewAnimationTransitionFlipFromLeft or UIViewAnimationTransitionFlipFromRight constant.

这篇关于PageTurn动画iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆