[컴][안드로이드] 2개의 view 에 2개의 다른 animation 을 동시에 실행하기


2개의 view 를 다른 속도로 움직이고 싶어서 animation 을 사용해서 작업을 했는데,
startAnimation() 을 두번써서는 제대로 움직이지 않았다. 따로 놀았다.

그래서 아래같은 답을 찾았다.

http://stackoverflow.com/questions/4196209/simultaneous-translations-on-android

애니메이션 하나는 setAnimation() 으로 설정만 해놓고, 한 쪽에서만 startAnimation() 을 해주면 된다. 아니면 글에서 처럼 양쪽 다 setAnimation() 으로 해줘도 된다.

그리고 setFillAfter() 도 필요한듯 하다. 아래에 setFillAfter() 에 대한 설명이 있다.

http://stackoverflow.com/questions/5886624/animation-setfillafter-before-do-they-work-what-are-they-for

댓글 1개:

  1. 와!! 감사합니다!!! 왜안되나 찾고 있었는데 명쾌한 해결입니다!!!

    답글삭제