Ich versuche, meine TextView unendlich zu animieren. Ich habe sequential.xml geschrieben, die den Animationseffekt definiert, wie nachfolgend beschrieben:Android TextView Animation unendliche Wiederholung funktioniert nicht
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator" >
<!-- Move -->
<translate
android:duration="800"
android:fillAfter="true"
android:fromXDelta="0%p"
android:startOffset="300"
android:toXDelta="2%p" />
<translate
android:duration="800"
android:fillAfter="true"
android:fromXDelta="0%p"
android:startOffset="1900"
android:toXDelta="-2%p" />
</set>
Der Code Aktivität, die diese Animation auf den Textview zuweisen wird, wie unten angegeben:
TextView tv = new TextView(this);
tv.setText(customObject.getText());
Animation animSequential;
animSequential = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.sequential_horizontal);
animSequential.setRepeatMode(Animation.RESTART);
animSequential.setRepeatCount(Animation.INFINITE);
tv.startAnimation(animSequential);
Aber es wiederholt nicht die Animation und kommt am Ende der ersten Iteration zum Stillstand. Bitte lassen Sie mich wissen, wenn ich etwas falsch verstanden habe.
siehe, ob http://stackoverflow.com/questions/4480652/android-animation-does-not-repeat hilft –