mmm*_*eys 4 android fixed-point rotation imageview rotateanimation
我想在固定点周围连续旋转360度图像.我已经看过几个例子,例如:
RotateAnimation anim = new RotateAnimation(0, 360,150,150);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(2000);
[imageview].startAnimation(anim);
Run Code Online (Sandbox Code Playgroud)
这会旋转图像,但它会在弧/圆形路径上旋转.IE浏览器.图像以圆周运动方式移动/旋转,但不会固定在它的起始位置.
我基本上想要的是模仿WindMill手臂的旋转.
有什么想法吗?
使用此代码
RotateAnimation rotateAnimation1 = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation1.setInterpolator(new LinearInterpolator());
rotateAnimation1.setDuration(duration);
rotateAnimation1.setRepeatCount(0);
img.startAnimation(rotateAnimation1);
Run Code Online (Sandbox Code Playgroud)
这会将图像旋转到固定位置,即自身周围
| 归档时间: |
|
| 查看次数: |
7637 次 |
| 最近记录: |