0
有没有办法阻止iOS 3中的动画?如何停止iOS中的UIView动画<4
我知道:
#import <QuartzCore/QuartzCore.h>
[view.layer removeAllAnimations];
,但它仅适用于iOS的4.0
有没有办法阻止iOS 3中的动画?如何停止iOS中的UIView动画<4
我知道:
#import <QuartzCore/QuartzCore.h>
[view.layer removeAllAnimations];
,但它仅适用于iOS的4.0
与此代码尝试:
if([view.layer repondsToSelector:@selector(removeAllAnimations)]) //Check if the CALayer responds to removeAllAnimations method for iOS4+
[view.layer removeAllAnimations];
else
[view.layer addAnimation:nil forKey:@"TheKeyOfTheAnimation"]; // Change TheKeyOfTheAnimation with key you have added animation for, you can also use nil for the key...
UPDATE:按照文档removeAllAnimations可用自iOS2.0以来 removeAllAnimations 删除所有连接到动画接收器。
- (void)removeAllAnimations
Availability
Available in iOS 2.0 and later.
Declared In
CALayer.h
Xcode直到我添加QuartzCore.framework才看到图层属性,如果我将QuartzCore.framework添加到库作为可选项并使用它,它会工作吗? –
没有理由将它添加为可选项,因为它自ios2.0以来就受到支持,所以不会有没有它的设备... – graver
谢谢你....) –