我做了一个帧动画,点击一个按钮以后会展示该动画,现在的问题是只有第一次点击的时候会出现该动画,再点就没有反应了,请问这是怎么回事?

解决方案 »

  1.   

    看下我的代码
    ?xml version="1.0" encoding="utf-8"?><animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true">
        <item android:drawable="@drawable/left" android:duration="100"/>
        <item android:drawable="@drawable/right" android:duration="100"/>
        <item android:drawable="@drawable/left" android:duration="100"/>
        <item android:drawable="@drawable/right" android:duration="100"/></animation-list>
    public void onClick(View view){
            ImageView imageView = (ImageView)findViewById(R.id.imageView);
            imageView.setBackgroundResource(R.drawable.animlist);
            AnimationDrawable animationDrawable = (AnimationDrawable)imageView.getBackground();
            animationDrawable.start();    }imageView.setBackgroundResource(R.drawable.animlist);
    这样算不算你说的重新加载下动画?
      

  2.   

    感觉android好多诡异的东西啊,这几天尝试动画制作,遇到N多问题
      

  3.   

    用之前没clear上次的动画??