我使用以下代码设置Frmae-by-frame动画:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
final ImageView back = (ImageView) findViewById(R.id.splash_image);
back.setBackgroundResource(R.drawable.splash_animation);
AnimationDrawable frameAnimation = (AnimationDrawable) back.getBackground();
// Start the animation (looped playback by default).
frameAnimation.setExitFadeDuration(2000);
frameAnimation.start();
}
但是,setExitFadeDuration
仅适用于API级别11.是否有替代我用于使动画与API 7向前兼容的代码