當前位置:編程學習大全網 - 網站源碼 - android幀動畫 可以設置在什麽組件上

android幀動畫 可以設置在什麽組件上

先在res目錄下(或anim目錄)創建壹個XML,裏面保存每個圖片的信息

/res/anim/loading.xml

<?xml version="1.0" encoding="utf-8"?>

<animation-list

android:oneshot="false"

xmlns:android="/apk/res/android"

>

<item android:duration="150" android:drawable="@drawable/recording1" />

<item android:duration="150" android:drawable="@drawable/recording2" />

<item android:duration="150" android:drawable="@drawable/recording3" />

<item android:duration="150" android:drawable="@drawable/recording4" />

<item android:duration="150" android:drawable="@drawable/recording5" />

<item android:duration="150" android:drawable="@drawable/recording6" />

<item android:duration="150" android:drawable="@drawable/recording7" />

</animation-list>

animation-list標簽就代表,這是壹組動畫的列表

android:oneshot屬性,表示循環播放,true則只播放壹次,false表示循環壹直播放。

item標簽代表各個幀元素

android:duration屬性代表幀與幀之間的持續時間,以毫秒為單位

android:drawable屬性代表具體的圖片信息。

  • 上一篇:n86的塞班系統有的Java遊戲打不開
  • 下一篇:Developer Settings是什麽
  • copyright 2024編程學習大全網