这就是所谓的:
-(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动画知之甚少,不知道如何解决这个问题