Android之中有 Obj 動畫 即 UI動畫 和 Image的Fragment動畫
①Image動畫
將一系列圖片照順序 排列 組成一個序列展示
XML文件存放路徑: res/anim/filename.xml
:
通過使用rescoure id進行訪問
<?xml version="1.0" encoding="utf-8"?>
<animation-listxmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<itemandroid:drawable="@drawable/rocket_thrust1"android:duration="200"/>
<itemandroid:drawable="@drawable/rocket_thrust2"android:duration="200"/>
<itemandroid:drawable="@drawable/rocket_thrust3"android:duration="200"/>
</animation-list>
使用動畫:
ImageView rocketImage =(ImageView) findViewById(R.id.rocket_image)
rocketImage.setBackgroundResource
(R.drawable.rocket_thrust);
rocketAnimation =(AnimationDrawable) rocketImage.
getBackground()
;
rocketAnimation.start()
;