2014-12-24 3 views
0

onAnimationRepeat에서 몇 가지 작업을 수행하고 싶습니다. 내 코드 :onAnimationRepeat의 코드가 실행되고 있지 않습니다.

final LinearLayout l = (LinearLayout) findViewById(R.id.parent); 

//line 03 

     RotateAnimation anim = new RotateAnimation(0, 0, 0, 0); 
     anim.setInterpolator(new LinearInterpolator()); 
     anim.setRepeatCount(4); 
     anim.setDuration(10); 

     anim.setAnimationListener(new AnimationListener() { 

      @Override 
      public void onAnimationStart(Animation animation) { 

      } 

      @Override 
      public void onAnimationRepeat(Animation animation) { 
//line 01 
       View v = LayoutInflater.from(MainActivity.this).inflate(
         R.layout.product_layout, null); 
       TextView t = (TextView) v.findViewById(R.id.test); 
       t.setText(i + ""); 

       View root = v.findViewById(R.id.root); 
       View face = v.findViewById(R.id.face); 
       View back = v.findViewById(R.id.back); 

       l.addView(v); 
       flipCard(root, face, back); 
//line 02 
       i++; 
      } 

      @Override 
      public void onAnimationEnd(Animation animation) { 

      } 
     }); 
     l.startAnimation(anim); 

그러나 작동하지 않습니다. line 01 - line 02 코드를 line 03에 복사하면 복사 된 코드와 line 01 - line 02 코드가됩니다.

무엇이 문제입니까? 감사합니다.

답변

0

내 문제가 해결되었습니다.

LinearLayout l

android:layout_height="wrap_content"

로 정의하고 비어이었다.

android:layout_height="match_parent"으로 변경했습니다.

내 문제가 해결되었습니다.

관련 문제