2016-09-16 3 views

답변

0

는 다른 (x, y)의 위치로 위치를 하나의 (X, Y)에서 간단한 애니메이션을 만들 수 있습니다. 내 onAnimationRepeat 방법에서

TranslateAnimation translateAnimation = new TranslateAnimation(0,0,100,100); 
    translateAnimation.setRepeatMode(Animation.INFINITE); 
    translateAnimation.setAnimationListener(new Animation.AnimationListener() { 
     @Override 
     public void onAnimationStart(Animation animation) { 

     } 

     @Override 
     public void onAnimationEnd(Animation animation) { 

     } 

     @Override 
     public void onAnimationRepeat(Animation animation) { 
      /* Set new from values, then generate new to values here, then restart animation */ 
     } 
    }); 

    View myView = new View(); 
    myView.startAnimation(translateAnimation); 

, 내가 애니메이션의 fromX 및 fromY 값을 재설정하고 새로운 독극물 장난감 값을 생성합니다 :

당신이 뭔가를 할 수 있습니다, 그것은 무한히 실행하고 싶었다면 그런 다음 다시 시작하십시오.

한 번에 여러 개의 다른 애니메이션을 수행해야하는 경우 한 지점에서 다른 지점으로 만보기가 이동하므로 사용자 정의 애니메이션을 만들어야 할 수도 있습니다.

관련 문제