iOS UIView动画(animationWithDuration :)有多个选项

Jus*_*ine 4 animation objective-c ios objective-c-blocks

我正在尝试UIView使用animationWithDuration多个选项实现动画块.它工作正常,除了它似乎只使用我指定的选项之一而不是所有三个.我可以指定的选项数量是否有限制或某些选项组合的限制?

以下是我的代码."starRotator"是UIImageViewUIView说我转动.我尝试在括号中包装选项,但这也不起作用.它似乎只采取UIViewAnimationOptionRepeat选择而忽略了其他两个.

[UIView animateWithDuration:30.0 
                      delay:0.0 
                    options:UIViewAnimationCurveLinear | UIViewAnimationOptionRepeat | UIViewAnimationOptionBeginFromCurrentState
                 animations:^{
                     starRotator.superview.transform = CGAffineTransformMakeRotation(M_PI);
                 }
                 completion:^(BOOL finished){ }
 ];
Run Code Online (Sandbox Code Playgroud)

rob*_*off 5

您是否注意到您使用的两个常量作为选项包含"选项"一词,但有一个不是?

线性曲线的正确选项常量是UIViewAnimationOptionCurveLinear,但是您使用了UIViewAnimationCurveLinear.