溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Android 圖片的幀動畫

發(fā)布時間:2020-07-14 15:33:46 來源:網(wǎng)絡(luò) 閱讀:338 作者:leeyulong 欄目:移動開發(fā)

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_p_w_picpath)

       rocketImage.setBackgroundResource(R.drawable.rocket_thrust);

rocketAnimation =(AnimationDrawable) rocketImage.getBackground();
rocketAnimation
.start();
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI