간단한 애니메이션 만들기

ㅇ 전형적인 애니메이션 사용방식은 애니메이션 액션 정보를 XML로 정의한 후 사용

ㅇ Animation 객체로 만든 후 뷰의 startAnimation() 메소드를 사용하면 간단하게 애니메이션 동작

   : 리소스 쪽에 애니메이션 액션정보 미리 구현

   : /res/anim/flow.xml -> AnimationUtils.loadAnimation() -> Animation객체 -> startAnimation() -> View객체

flow.xml 예제

<set>

   <translate

      android:fromYDelta="0%p" //출발점

      android:toYDelty="100%p" //도착점

      android:duration="3000"    //이동시간 3초

   </trandslate>

</set>

 

애니메이션 2개 이상을 이어 붙이고 싶은 경우, onAnimationEnd()메소드로 처음 애니메이션이 끝나는 시점 인지

다시말해, onAnimationEnd() 메소드 내에서 두번째 애니메이션에 대한 startAnimation() 호출

by wisegirl 2013. 2. 28. 23:03