如何停止动画(cancel() 不起作用) [英] How to stop an animation (cancel() does not work)

查看:36
本文介绍了如何停止动画(cancel() 不起作用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要停止正在运行的翻译动画.Animation.cancel()方法没有效果;无论如何,动画一直持续到最后.

I need to stop a running translate animation. The .cancel() method of Animation has no effect; the animation goes until the end anyway.

如何取消正在运行的动画?

How do you cancel a running animation?

推荐答案

在您调用 startAnimation() 的任何 View 上调用 clearAnimation().

Call clearAnimation() on whichever View you called startAnimation().

这篇关于如何停止动画(cancel() 不起作用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆