我的设置有问题UIViewAnimationOptionAutoReverse.这是我的代码.
CALayer *aniLayer = act.viewToChange.layer;
[UIView animateWithDuration:2.0 delay:1.0 options:(UIViewAnimationCurveLinear | UIViewAnimationOptionAutoreverse) animations:^{
viewToAnimate.frame = GCRectMake(1,1,100,100);
[aniLayer setValue:[NSNumber numberWithFloat:degreesToRadians(34)] forKeyPath:@"transform.rotation"];
} completion:nil ];
Run Code Online (Sandbox Code Playgroud)
问题是,在动画反转后,视图会跳回到动画块中设置的帧.我希望视图成长并"取消"并停在原来的位置.
有没有编程两个连续动画的解决方案?