小编Joh*_*ohn的帖子

Android-setDuration不工作?ObjectAnimtaor

我正在尝试使用ObjectAnimator向下移动ImageView.setDuration()方法似乎不会影响动画的持续时间.我不能在XML中设置这个动画,因为我想动态地播放它.

    ObjectAnimator an= ObjectAnimator.ofFloat(img, View.TRANSLATION_Y, 0, 100);
    an.setDuration(5000);
    an.start();
Run Code Online (Sandbox Code Playgroud)

在这里对主题进行排序,但是说我想在彼此之后玩多个ObjectAnimation,有没有办法做到这一点?我看过Animator集,但我不确定它是否会像Object Animator一样移动实际对象,而不是像TranslateAnimation那样出现.

提前致谢!

animation android

2
推荐指数
1
解决办法
3244
查看次数

标签 统计

android ×1

animation ×1