gpt4 book ai didi

ios - 知道 UIProgressView 何时停止动画

转载 作者:行者123 更新时间:2023-12-01 17:49:59 31 4
gpt4 key购买 nike

UIProgressView有这个setProgress:animated: API。

有没有办法确切知道动画何时停止?

我的意思是这样的?

[myProgress setProgress:0.8f animated:YES onCompletion...]

一旦动画结束,我想开始淡出进度。

最佳答案

发件人:https://stackoverflow.com/a/16368679/74815

当您不是动画的作者时,您可以使用事务完成 block 在动画结束时获得回调:

[CATransaction setCompletionBlock:^{
// doSomethingElse
}];
// doSomething

来自 Apple documentation :

Discussion

The completion block object that is guaranteed to be called (on the main thread) as soon as all animations subsequently added by this transaction group have completed (or have been removed.) If no animations are added before the current transaction group is committed (or the completion block is set to a different value,) the block will be invoked immediately.

关于ios - 知道 UIProgressView 何时停止动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33943219/

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