为什么动画效果一个有一个没有

- (void)viewDidLoad

{

super viewDidLoad];

// Do any additional setup after loading the view.

timer = NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES];

CABasicAnimation *anim1 = CABasicAnimation animationWithKeyPath:@"transform"];

anim1.toValue = NSValue valueWithCATransform3D:CATransform3DMakeRotation(3.1415, 1.0, 0, 1.0)];

anim1.duration = 2;

anim1.cumulative = YES;

anim1.repeatCount = 1000;

CABasicAnimation *anim2 = CABasicAnimation animationWithKeyPath:@"transform2"];

anim2.toValue = NSValue valueWithCATransform3D:CATransform3DMakeRotation(3.1415, 0, 1.0, 1.0)];

anim2.duration = 2;

anim2.cumulative = YES;

anim2.repeatCount = 1000;

image1.layer addAnimation:anim1 forKey:@"transformAnimation"];

image2.layer addAnimation:anim2 forKey:@"transform2Animation"];

}

此处我分别对image1和image2添加了不同的动画,为什么只有image1最后显示出我指定的动画效果,而image2完全没有反应啊!(ps:image1和image2都为UIImageView对象)

CABasicAnimation *anim2 = CABasicAnimation animationWithKeyPath:@"transform"];



transform好像是系统定义的吧。应该不能改的。

CABasicAnimation *anim2 = CABasicAnimation animationWithKeyPath:@"transform2"];

Core Animation中没有“transform2”这个键值,你可以断点看一下anim2是什么,应该是nil吧。可以去看看Core animation提供的键值有那些...