【发布时间】:2011-01-20 02:26:31
【问题描述】:
嗨 我只是在玩一些基本的 UIView 动画。 我将重复计数设置为 100,这样我就可以看到它一遍又一遍地上下波动。 我设置了一个过渡来将我的视图旋转 180 度
我可以看到我的视图在移动时旋转。 然而,经过一些重复.. 视图仍在上下移动,但不再旋转。 我不明白为什么它会停止在同一个循环中旋转?
下面是我的代码:
- (void)viewDidLoad {
[super viewDidLoad];
CGAffineTransform trans = CGAffineTransformMakeRotation(M_PI);
Shape* shapeView = [[Shape alloc] initWithShapeName:@"test" frame:CGRectMake(100, 0, 50, 50)];
[self.view addSubview:shapeView];
[UIView beginAnimations:@"test animation" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationRepeatCount:100];
shapeView.transform = trans;
[UIView setAnimationRepeatAutoreverses:YES];
shapeView.frame = CGRectMake(100,300,50,50);
[UIView commitAnimations];
[shapeView release];
}
谢谢
【问题讨论】: