-1
A
回答
0
这听起来像你正在寻找一个TranslateAnimation
TranslateAnimation允许您创建从一个(X,Y)一个简单的动画位置到另一个位置(X,Y)的位置。
如果你想让它无限的运行,你可以做这样的事情:
TranslateAnimation translateAnimation = new TranslateAnimation(0,0,100,100);
translateAnimation.setRepeatMode(Animation.INFINITE);
translateAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
/* Set new from values, then generate new to values here, then restart animation */
}
});
View myView = new View();
myView.startAnimation(translateAnimation);
在我onAnimationRepeat
的方法,我会重新设置动画的fromX和弗罗米值,并产生新的TOX和玩具价值,然后重新开始。
这只会从一个点移动视图到另一个,如果你需要它做一次多个不同的动画,你可能需要创建一个自定义动画。
相关问题
- 1. 在Android上使用翻译动画移动图像的问题
- 2. 移动videoView ...使用翻译动画
- 3. Android翻译动画
- 4. Android翻转图像动画
- 5. 翻译动画
- 6. Android动画。两个翻译活动
- 7. 翻转图像/动画,使其跟随移动方向
- 8. Android图像移动动画问题
- 9. 使用CSS3动画移动图像
- 10. Android翻译动画移动到绝对位置
- 11. SVG动画翻译
- 12. JavaFX移动图像动画
- 13. 翻译CSS动画WPF动画
- 14. 在Android代码中的动画翻译
- 15. flickering在Android中翻译动画
- 16. Android翻译动画导致Clicklistener问题
- 17. 在Android中翻译动画问题
- 18. android:如何动画翻译一层LayerDrawable
- 19. android frame-by-frame动画和翻译
- 20. Android的翻译动画进度回调
- 21. Android图像动画
- 22. Android:动画图像?
- 23. ImageView scale +翻译动画
- 24. 翻译动画无效
- 25. 翻译动画代码
- 26. 缩放和翻译动画
- 27. 在Firefox中翻译动画
- 28. Nativescript无限翻译动画
- 29. UIVIew动画 - 缩放+翻译
- 30. 翻译和缩放动画