嘿,所有的,在这里有一个小问题,并不能弄清楚我做错了什么。我正在尝试向上和向下反复动画UIView。当我开始播放时,它会正确地下降然后备份,但会立即开始播放到动画的“最终”位置。代码如下:iPhone - UIView动画没有正确循环
UIImageView *guide = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]];
guide.frame = CGRectMake(250, 80, 30, 30);
[self.view addSubview:guide];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:2];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationBeginsFromCurrentState:YES];
guide.frame = CGRectMake(250, 300, 30, 30);
[UIView setAnimationRepeatCount:10];
[UIView commitAnimations];
在此先感谢!