각 프레임을 드로어 블 폴더에 별도의 이미지로 만듭니다. 그 후, (예를 들어, ANIMATED.xml)
<animation-list android:id="@+id/selected" android:oneshot="false">
<item android:drawable="@drawable/0" android:duration="50" />
<item android:drawable="@drawable/1" android:duration="50" />
<item android:drawable="@drawable/2" android:duration="50" />
<item android:drawable="@drawable/3" android:duration="50" />
<item android:drawable="@drawable/4" android:duration="50" />
<item android:drawable="@drawable/5" android:duration="50" />
</animation-list>
그리고 애니메이션을 만들 수있는 프레임을 정의하기 위해 XML을 사용하여, 이것을 사용 :
// Load the ImageView that will host the animation and
// set its background to our AnimationDrawable XML resource.
ImageView img = (ImageView)findViewById(R.id.moving_image);
img.setBackgroundResource(R.drawable.ANIMATED.xml);
// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
// Start the animation (looped playback by default).
frameAnimation.start();
당신은 VideoView를 지켜 보면서을 사용하는 생각? –
@harvey_slash VideoView 클래스를 거친 후 필자는 필자의 요구 사항에 적합하지 않다고 생각합니다. MediaController와 함께 VideoView를 사용하면 이러한 기능이 필요하지 않지만 일시 중지 할 수있는 옵션이 제공됩니다. – Sri