CA BASIC ANIMATION で同じ画像を同時に回転および移動する必要があります。iphone SDK でこれを行う方法はありますか?
どんな助けでも大歓迎です
これは私のコードです
imgview = (UIImageView *)[self.view viewWithTag:imagenumber];
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
anim.fromValue = [NSValue valueWithCGPoint:CGPointMake(160 + x_movefrom, 240 + y_movefrom)];
anim.toValue = [NSValue valueWithCGPoint:CGPointMake(160 + x_moveto, 240 + y_moveto)];
anim.duration = 2;
anim.removedOnCompletion = YES;
//imgview = (UIImageView *)[self.view viewWithTag:imagenumber];
CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"alpha"];
opacityAnim.fromValue = [NSNumber numberWithFloat:1.0];
opacityAnim.toValue = [NSNumber numberWithFloat:0.0];
opacityAnim.removedOnCompletion = NO;
CAAnimationGroup *animGroup = [CAAnimationGroup animation];
animGroup.animations = [NSArray arrayWithObjects:opacityAnim,anim, nil];
animGroup.duration = 2;
animGroup.delegate = self;
animGroup.removedOnCompletion = NO;
[imgview.layer addAnimation:animGroup forKey:nil];