syxChina 发表于 2012-12-19 22:15:01

IOS之动画

<div id="cnblogs_post_body">15.1 动画介绍
15.2 Core Animation基础
15.3 隐式动画
15.4 显式动画
15.5 关键帧显式动画
15.6 UIView级别动画
15.1 动画介绍

在iOS中动画实现技术主要是:Core Animation。 Core Animation负责所有的滚动、旋转、缩小和放大以及所有的iOS动画效果。其中UIKit类通常都有animated:参数部分,它可以允许是否使用动画。
Core Animation还与Quartz紧密结合在一起,每个UIView都关联到一个CALayer对象,CALayer是Core Animation中的图层。
15.2 Core Animation基础

Core Animation创建动画时候会修改CALayer属性,然后让这些属性流畅地变化。Core Animation相关知识点:
图层,图层是动画发生的地方,CALayer总是与UIView关联,通过layer属性访问。
隐式动画,这是一种最简单的动画,不用设置定时器,不用考虑线程或者重画。
显式动画,是一种使用CABasicAnimation创建的动画,通过CABasicAnimation,可以更明确地定义属性如何改变动 画。
关键帧动画,这是一种更复杂的显式动画类型,这里可以定义动画的起点和终点,还可以定义某些帧之间的动画。
15.3 隐式动画

http://images.cnblogs.com/cnblogs_com/syxchina/201210/201210142328089072.png
实例ianimate:
<div class="cnblogs_code">#import <UIKit/UIKit.h>#import <QuartzCore/QuartzCore.h>@interface ianimateViewController : UIViewController {    IBOutlet UIImageView *plane;}-(IBAction)movePlane:(id)sender;@end//--m-(IBAction)movePlane:(id)sender {      ;    CGAffineTransform moveTransform = CGAffineTransformMakeTranslation(180, 200);    plane.layer.affineTransform=moveTransform;    plane.layer.opacity = 1;    ;}
页: [1]
查看完整版本: IOS之动画