相关疑难解决方法(0)

使用自动反转的UIView动画

我的设置有问题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)

问题是,在动画反转后,视图会跳回到动画块中设置的帧.我希望视图成长并"取消"并停在原来的位置.

有没有编程两个连续动画的解决方案?

animation cocoa-touch uiviewanimation ios

36
推荐指数
2
解决办法
3万
查看次数

标签 统计

animation ×1

cocoa-touch ×1

ios ×1

uiviewanimation ×1