我想摇一个价格按钮。每次倒车后,它应该等待几秒钟。
[UIView animateWithDuration:0.14f delay:0 options:(UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat | UIViewAnimationCurveEaseInOut) animations:^{
self.priceButton.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(3));
self.priceButton.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(-6));
self.priceButton.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(3));
} completion:nil];
我该怎么做?
答案 0 :(得分:0)
你可以让每个旋转都在它自己的animateWithDuration块中完成彼此,或者你可以将它们中的每一个放在一个选择器中并调用:
[self performSelector:@selector(setRad:) withObject:[NSNumber numberWithInt:(either -6 or 3 here)] afterDelay:0.14f*(either 0 1 or 2)];
然后在选择器setRad中,在动画块中设置变换。