gpt4 book ai didi

cocoa-touch - 内置 UIView 动画的核心动画等价物

转载 作者:行者123 更新时间:2023-11-28 23:16:19 25 4
gpt4 key购买 nike

我正在为以下 UIView 动画寻找等效的核心动画?

[UIView animateWithDuration:0.25 animations:^(void) {
cell.frame = newCellFrame;

} completion:^(BOOL finished) {
[UIView animateWithDuration:0.25 animation:^(void) {
cell.frame = finalCellFrame;
}];
}];

我特别想知道的是你是如何用核心动画来模拟这个动画的“完成”部分的。是使用核心动画委托(delegate)的唯一选择还是有像上述代码片段一样优雅的解决方案?

最佳答案

在 CoreAnimation 中,它是通过委托(delegate)完成的。您可以在您的 CAAnimation/CABasicAnimation 实例上设置一个委托(delegate),动画将向您发出 animationDidStart:animationDidStop:finished: 回调。

关于cocoa-touch - 内置 UIView 动画的核心动画等价物,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6233470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com