在上图中,有一条白线,我只想根据角度在圆圈中为该图像设置动画。假设如果我的角度是 20 度,那么那条白线的动画是 58 度,它会像下图一样
她是我的密码
UIImageView *imgBenchmark = [[UIImageView alloc]initWithFrame:CGRectMake(153,70, 1, 26)];
self.benchmark = imgBenchmark;
[imgBenchmark release];
self.benchmark.layer.anchorPoint = CGPointMake(self.benchmark.layer.anchorPoint.x, self.benchmark.layer.anchorPoint.y*2);
self.benchmark.backgroundColor = [UIColor clearColor];
self.benchmark.image = [UIImage imageNamed:@"line.png"];
[self.view addSubview:self.benchmark];
[self rotateIt1:20];
-(void) rotateIt1:(float)angl
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.01f];
[self.benchmark setTransform: CGAffineTransformMakeRotation((M_PI / 9) *angl)];
[UIView commitAnimations];
}