问题
This is just a continuation of my unsolved question which can be found here: Animate ImageView
For now, I managed to make the imageviews move using
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0%"
android:duration="2000"/>
</set>
But what I want to accomplish is the images should accelerate from left to right and when they reach the end, they should re-appear on the activity again.
Any help and suggestion are truly appreciated. Thanks.
回答1:
To repeat animation put:
android:repeatCount="-1"
If you wanna imageView reappear from right to left put:
android:repeatMode="reverse"
回答2:
You should use SurfaceView instead of moving ImageViews.
来源:https://stackoverflow.com/questions/16399630/infinite-animation-of-imageview-android