逐帧动画API兼容性

时间:2012-11-08 10:17:38

标签: android

我使用以下代码设置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向前兼容的代码

0 个答案:

没有答案