У меня есть шесть изображений с помощью AnimationDrawable. Он был успешно анимирован.Нужна помощь по анимации в Android
Но это только анимирует то же место.
Но мне нужно двигаться вперед, когда отображается следующий кадр. Как я могу это показать.
Мой код.,
<?xml version="1.0" encoding="utf-8"?><animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
<item android:drawable="@drawable/frog" android:duration="50" />
<item android:drawable="@drawable/frog1" android:duration="50" />
<item android:drawable="@drawable/frog2" android:duration="50" />
<item android:drawable="@drawable/frog3" android:duration="50" />
<item android:drawable="@drawable/frog4" android:duration="50" />
<item android:drawable="@drawable/frog5" android:duration="50" /> </animation-list>
private void animate() {
ImageView imgView = (ImageView) findViewById(R.id.animationImage);
// imgView.setVisibility(ImageView.VISIBLE);
imgView.setBackgroundResource(R.drawable.ani);
AnimationDrawable frameAnimation = (AnimationDrawable) imgView
.getBackground();
if (frameAnimation.isRunning()) {
frameAnimation.stop();
b.setText("Start");
} else {
frameAnimation.start();
b.setText("Stop");
}
}
При показе следующего кадра, его двигаться вперед местоположение. Помогите мне.
вы также можете увидеть http://stackoverflow.com/questions/8386449/android-text-animation – pengwang