ObjectAnimator.setDuration被忽略 [英] ObjectAnimator.setDuration is ignored

查看:596
本文介绍了ObjectAnimator.setDuration被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android中 ObjectAnimator 类的setDuration函数似乎被完全忽略了。无论我传递什么值,动画总是立即完成。

The setDuration function of the ObjectAnimator class in Android appears to be completely ignored. No matter what value I pass it, the animation is always completed instantly.

    ObjectAnimator.ofFloat(mView, "translationY", 0, 100)
            .setDuration(2000)
            .start();

上面的代码增加了 mView 100(基本上将其向下推到屏幕下方)。实际翻译正确进行,但是是瞬时的。 setDuration(2000)被完全忽略。为什么?

The above code increases the Y value of mView by 100 (essentially pushing it further down the screen). The actual translation occurs correctly, however it is instantaneous. The setDuration(2000) is completely ignored. Why is this?

编辑:

这似乎是基于设备的-三星galaxy s4似乎无法正确插入视图。这与此问题相同。

This seemsto be based on the device - the samsung galaxy s4 appears to have an issue with interpolating views correctly. This is the same issue as this question.

推荐答案

事实证明,这是开发人员选项下默认动画持续时间比例的问题。我在此处回答了类似的问题。

This turned out to be an issue with the default animation duration scale under Developer Options. I've answered a similar question here.

这篇关于ObjectAnimator.setDuration被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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