0

我想摇动价格按钮。每次倒车后,它应该等待几秒钟。

 [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];

我怎样才能做到这一点?

4

1 回答 1

0

您可以让每个旋转都在其自己的 animateWithDuration 块中彼此完成,或者您可以将它们中的每一个放在一个选择器中并调用:

[self performSelector:@selector(setRad:) withObject:[NSNumber numberWithInt:(either -6 or 3 here)] afterDelay:0.14f*(either 0 1 or 2)];

然后在选择器 setRad 中,在动画块中设置变换。

于 2013-03-20T00:13:31.907 回答