gpt4 book ai didi

android - 调用 animation.stop() 和 reset() 时动画不会停止

转载 作者:行者123 更新时间:2023-11-29 01:48:08 25 4
gpt4 key购买 nike

我的 Chronometer 上有一个动画,当我启动它时它运行良好。我是这样开始的:

chTimer.stop();
chTimer.startAnimation(animBlink);

然后我试图取消这样的动画:

chTimer.start();
animBlink.cancel();
animBlink.reset();

动画无论如何都不会停止。即使调用了 cancel() 和 reset(),它也会继续播放(闪烁)。

最佳答案

要为任何View 停止Animation,你应该使用这个:

chTimer.clearAnimation();
chTimer.setAnimation(null);

它应该可以工作1

1我在我的项目中使用这种方法并且从未遇到过这个问题。

关于android - 调用 animation.stop() 和 reset() 时动画不会停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20106681/

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