2012-04-11 1 views
1

단계로 (-100, 0)에서 (10, 1) - (100, 2) 단계로보기를 이동하고 싶습니다. . TranslateAnimation을 시도했습니다. 그러나 나는 실패했다. 첫 번째 단계에서만 작동합니다. 설정된대로 작동하지 않습니다.android에서 TranslateAnimation을 통해 단계별 이동 방법

x1 = (0-layoutW); 
x2 = (45*Constant.metricW-layoutW); 
y1 = layoutH; 
y2 = ((356-layoutH)*Constant.metricH); 
Animation step1 = new TranslateAnimation(
      Animation.ABSOLUTE, x1, Animation.ABSOLUTE, x2, 
      Animation.ABSOLUTE, y1, Animation.ABSOLUTE, y2); 
step1.setStartOffset(300); 
step1.setDuration(100); 
step1.setInterpolator(new AccelerateInterpolator()); 
animationSet.addAnimation(step1); 

x1 = (45*Constant.metricW-layoutW); 
x2 = (86*Constant.metricW-layoutW); 
y1 = ((356-layoutH)*Constant.metricH); 
y2 = ((288-layoutH)*Constant.metricH); 
Animation step2 = new TranslateAnimation(x1, x2, y1, y2);  
step2.setStartOffset(400); 
step2.setDuration(100);  
step2.setInterpolator(new AccelerateInterpolator()); 
step2.setFillAfter(true); 
animationSet.addAnimation(step2); 

내가 놓친 게 있나 :

이 내 코드? 감사합니다. .

답변

관련 문제