我正在使用此代码为我的视图制作涟漪动画
transition = [CATransition animation];
transition.delegate = self;
transition.duration = 3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
NSString *types[4] = {@"cube", @"rippleEffect", @"cube", @"alignedCube"};
NSString *subtypes[4] = {kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromRight};
transition.type = types[1];
transition.subtype = subtypes[1];现在我想通过点击来停止动画,然后我想从我停止的视图开始...
我试过了
view.layer removeAllAnimations;
但我发现以下事情并不适用于..Any建议?
发布于 2012-08-29 17:42:12
将动画速度设置为0可暂停动画,设置为1可再次恢复动画。看一看https://developer.apple.com/library/ios/#qa/qa2009/qa1673.html
发布于 2012-08-29 17:50:58
可以从CALayer获取当前动画状态。
#import <QuartzCore/QuartzCore.h>
myView.layer.modelLayer.frame = myView.layer.presentationLayer.frame;https://stackoverflow.com/questions/12174489
复制相似问题