摘要:
- (void)tapAction:(UITapGestureRecognizer *)recognizer{ // 取出手势的触摸点 CGPoint location = [recognizer locationInView:self.view]; // 1. 实例化动画组 CAAnimationGroup *group = [[CAAnimationGroupalloc]init]; CFTimeInterval duration = 2.0; // 2. 定义动画组中的动画// CAKeyframeAnimation *anim1 = [AnimationView mo...
阅读全文
posted @ 2013-09-30 23:45
老猫zl
阅读(167)
推荐(0)
编辑
摘要:
如果使用路径动画,设置的关键点values就失去作用。0)创建动画1) 创建路径2)设置路径内容3)将路径添加到动画4)释放路径5)将动画添加到图层//// AnimationView.m// 关键帧动画_demo1//// Created by mac on 13-9-30.// Copyright (c) 2013年 mac. All rights reserved.//#import "AnimationView.h"#import @implementation AnimationView- (id)initWithFrame:(CGRect)frame{ self
阅读全文
posted @ 2013-09-30 19:51
老猫zl
阅读(489)
推荐(0)
编辑
摘要:
关键帧动画和基本动画一样。创建步骤都是1 实例化动画对象2 设置属性3 添加到图层。如果使用了路径,values属性就被忽略。对于位移动画,需要在动画结束时候,设置视图位置。在创建动画的时候需要设置代理。然后在动画结束代理程序里设置位置。//// AnimationView.m// 关键帧动画_demo1//// Created by mac on 13-9-30.// Copyright (c) 2013年 mac. All rights reserved.//#import "AnimationView.h"#import @implementation Animati
阅读全文
posted @ 2013-09-30 18:19
老猫zl
阅读(279)
推荐(0)
编辑
摘要:
基本动画创建的步骤1 根据keypath创建动画对象2 设置基本属性3 添加到视图的图层//// MainViewController.m// animation_demo3//// Created by mac on 13-9-30.// Copyright (c) 2013年 mac. All rights reserved.//#import "MainViewController.h"@interfaceMainViewController ()@property (nonatomic,weak) UIView *myview;@end@implementation
阅读全文
posted @ 2013-09-30 15:59
老猫zl
阅读(435)
推荐(0)
编辑
摘要:
CABasicAnimation animationWithKeyPath TypesWhen using the ‘CABasicAnimation’ from the QuartzCore Framework in Objective-C, you have to specify an animationWithKeyPath.This is a long string and is not easily listed in the CABasicAnimation, CAPropertyAnimation, or the CAAnimation class.I ended up find
阅读全文
posted @ 2013-09-30 13:11
老猫zl
阅读(666)
推荐(0)
编辑