首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

【转】CATransition的卡通片效果类型及实现方法

2012-09-27 
【转】CATransition的动画效果类型及实现方法实现iphone漂亮的动画效果主要有两种方法,一种是UIView层面的,

【转】CATransition的动画效果类型及实现方法
实现iphone漂亮的动画效果主要有两种方法,一种是UIView层面的,一种是使用CATransition进行更低层次的控制,

第一种是UIView,UIView方式可能在低层也是使用CATransition进行了封装,它只能用于一些简单的、常用的效果展现,这里写一个常用的示例代码,供大家参考。

// Curl the image up or downCATransition *animation = [CATransition animation];[animation setDuration:0.35];[animation setTimingFunction:UIViewAnimationCurveEaseInOut];if (!curled){//animation.type = @"mapCurl";animation.type = @"pageCurl";animation.fillMode = kCAFillModeForwards;animation.endProgress = 0.99;} else {//animation.type = @"mapUnCurl";animation.type = @"pageUnCurl";animation.fillMode = kCAFillModeBackwards;animation.startProgress = 0.01;}[animation setRemovedOnCompletion:NO];[view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];[view addAnimation:animation forKey"pageCurlAnimation"];// Disable user interaction where necessaryif (!curled) { } else { }curled = !curled;


转自http://blog.csdn.net/thomasqiujs/article/details/6628353

热点排行