remote_recording_transition.xml 文件
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/remote_recording" android:duration="800"></item>
<item android:drawable="@drawable/remote_recording_run" android:duration="800"></item>
</animation-list>
android:oneshot="false" 是否循環播放,flase是循環播放 true只播一次
android:duration="800" 間隔時間
java代碼
private AnimationDrawable recordingTransition;
recording=(ImageView)findViewById(R.id.recording);
recording.setBackgroundResource(R.drawable.remote_recording_transition);
recordingTransition = (AnimationDrawable) recording.getBackground();
recordingTransition.start();
--------------------------可以加我微信號:googlecao 進行交流------------------------
如果你覺得此文章對你有用,給我點動力,請我喝杯奶茶咯