【发布时间】:2014-06-07 16:07:51
【问题描述】:
我看到很多人用它来禁用隐式动画:
[CATransaction begin];
[CATransaction setDisableActions:YES];
someLayer.backgroundColor = someCGColor;//no animation
[CATransaction commit];
但如果没有 CATransaction begin&commit 它也可以工作:
[CATransaction setDisableActions:YES];
someLayer.backgroundColor = someCGColor;//no animation
这样它也可以工作:
[CATransaction setDisableActions:YES];
someLayer1.backgroundColor = someCGColor;//no animation
[CATransaction setDisableActions:NO];
someLayer2.backgroundColor = someCGColor2; //have animation
所以问题是,为什么我需要使用 CATransaction begin&commit?有没有我必须使用它们的案例?
谢谢,阿恩。
【问题讨论】:
标签: ios objective-c core-animation catransaction