0
저는 AnimationDrawable을 사용하여 6 개의 이미지를 표시했습니다. 그것은 성공적으로 애니메이션되었습니다.안드로이드의 애니메이션에 대한 도움이 필요합니다.
하지만 같은 장소에서만 움직입니다.
하지만 다음 프레임이 표시 될 때 앞으로 이동해야합니다. 어떻게 보여줄 수 있습니까?
내 코드입니다., 다음 프레임을 표시 할 때, 앞으로 위치를 이동
<?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");
}
}
. Pls 날 도와 줘요.
당신은 또한 볼 수 있습니다 http://stackoverflow.com/questions/8386449/android-text-animation – pengwang