动画图像按钮以圆周运动

时间:2016-09-02 06:07:33

标签: android android-animation objectanimator

我正在尝试使用ObjectAnimator为图像按钮设置动画以循环移动

PropertyValuesHolder tranX = PropertyValuesHolder.ofFloat(View.TRANSLATION_X, path);
PropertyValuesHolder tranY = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, path);
ObjectAnimator scaleAnimation =
            ObjectAnimator.ofPropertyValuesHolder(scaleButton, pvhX, pvhY);
scaleAnimation.setRepeatCount(1);
scaleAnimation.setRepeatMode(ValueAnimator.REVERSE);

我试图用:

创建一条路径
Path path_x = new Path();
Path path_y = new Path();
for(i = 0; i < 2* Math.PY; i += 0.1)
  {
    \\save a path with cos and sin     
  }

但我不知道在for循环中使用什么方法 如果它甚至可能

我会尝试任何其他方式来创建圆周运动

0 个答案:

没有答案
相关问题