【发布时间】:2012-03-16 04:44:58
【问题描述】:
我想以 90 度角旋转图像(左右旋转)。我使用以下代码以 360 度角向左旋转。如何以 90 度角旋转图像。
-(IBAction)btnLeftRotateClicked:(id)sender
{
CATransform3D rotationTransform = CATransform3DMakeRotation(1.0f * M_PI, 0, 0, 1.0);
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
rotationAnimation.toValue = [NSValue valueWithCATransform3D:rotationTransform];
rotationAnimation.duration = 0.25f;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 1;
[imageAdjustView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
谢谢。
【问题讨论】: