动画帧实现方法一
主xml中
<ImageView android:id="@+id/imgFrame" android:layout_width="60dip" android:layout_height="60dip" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:background="@anim/my_frame_bubble" />
动画:anim/myframe_bubble
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:apk="http://schemas.android.com/apk/res/android" apk:oneshot="false">
<item apk:drawable="@drawable/bubble1" apk:duration="500" />
<item apk:drawable="@drawable/bubble2" apk:duration="500" />
</animation-list>
主程序中:
// ***动画帧 this.imgFrame = (ImageView) super.findViewById(R.id.imgFrame); this.animFrame = (AnimationDrawable) this.imgFrame.getBackground(); this.animFrame.stop(); this.animFrame.start();
浙公网安备 33010602011771号