风言枫语  

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();



 

posted on 2013-10-10 21:29  风言枫语  阅读(612)  评论(0编辑  收藏  举报