1
한 좌표에서 다른 좌표로보기를 변환해야하는 응용 프로그램에서 작업 중입니다. x1 = 191, y1 = 300 x2 = 50, y2 = 150안드로이드에서 한 좌표에서 다른 좌표로 변환
다음 코드를 사용했지만 매우 이상하게 작동합니다. 두 점 사이에서 변환하거나 번역하지 않습니다.
코드 :
Animation transAnim = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, x,
Animation.RELATIVE_TO_PARENT, pawnInitLocation[0],
Animation.RELATIVE_TO_PARENT, y,
Animation.RELATIVE_TO_PARENT, pawnInitLocation[1]);
transAnim.setDuration(1000);
transAnim.setFillEnabled(true);
transAnim.setFillAfter(true);
v.startAnimation(transAnim);
내가 안드로이드에서 애니메이션에 새로운 오전 정말 이런 건을 달성 havent 한. 어떤 도움이라도 좋을 것입니다.
당신은 UI 스레드에서 이러한 작업을 수행하는? – Premsuraj
예, MotionEvent.ACTION_UP에서 이들을 수행 중이며, x 및 y는 evet.getRawX() 및 event.getRawY()입니다. – ark