这是我正在使用的代码。但是它不起作用(仅执行一次)。我做错了什么?
[UIView animateWithDuration:4.0 delay:0.0 options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionCurveEaseInOut animations:^{
NSLog(@"animating...");
laserView.frame = CGRectMake(0, scannerOverlayView.frame.size.height, scannerOverlayView.frame.size.width, 3);
} completion:^(BOOL done){
}];
您必须更新完成块中的第一帧。
completion:^(BOOL done){
laserView.frame = initial frame
}];