2011-10-11 4 views
1

I 직사각형 영역 뷰를 회전하지만 그 뷰의 초점 영역을 회전시키지 않고이 방법안드로이드 뷰 회전 애니메이션이 포커스 영역을 회전시키지 않습니까?

 AnimationSet snowMov1 = new AnimationSet(true); 
     RotateAnimation rotate1 = new RotateAnimation(0,-90, Animation.RELATIVE_TO_SELF,0.0f , Animation.RELATIVE_TO_SELF,0.0f); 
     rotate1.setDuration(000); 
     snowMov1.addAnimation(rotate1); 

     TranslateAnimation trans1 = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 1.0f); 
     trans1.setDuration(000); 
     snowMov1.addAnimation(trans1); 
     snowMov1.setFillAfter(true); //this will apply the animation and keep the transformation 

이 이후에 변환을 적용하고있다. 초점 영역은 동일하게 유지됩니다. 누군가가 초점 영역을 어떻게 회전시킬 수 있는지 알려주세요.

감사합니다.

답변

2

불행히도 자동으로 수행 할 방법이 없습니다. 애니메이션은 뷰의 그리기 위치 만 업데이트하고 실제 위치는 업데이트하지 않습니다. 여기서 가장 좋은 방법은 애니메이션의 리스너를 설정하고 실제로 onAnimationEnd 메소드의 위치를 ​​변경하는 것입니다.

관련 문제