0

这就是所谓的:

-(IBAction)preform:(id)sender{
 CALayer *layer = [CALayer layer];
 [layer setPosition:CGPointMake(100.0, 100.0)];
 [layer setBounds:CGRectMake(0.0, 0.0, 50.0, 60.0)];
 [layer setBackgroundColor:[[UIColor redColor] CGColor]];
 [self.view.layer addSublayer:layer];

 CABasicAnimation *animation = [CABasicAnimation animation];
 [animation setFromValue:[NSValue valueWithCGPoint:CGPointMake(100.0, 100.0)]];
 animation.toValue = [NSValue valueWithCGPoint:CGPointMake(100.0, 250.0)];
 [layer addAnimation:animation forKey:@"position"];
}

这是错误:我对 IOS 动画知之甚少,不知道该怎么做

http://i.stack.imgur.com/IMu0F.png

4

1 回答 1

0

您必须将框架 QuartzCore 添加到您的项目中。

这是如何.. https://stackoverflow.com/a/6961788/1518182

于 2013-02-11T01:15:00.620 回答