Ich versuche, meine Tasten animieren von einem einzigen Punkt wie im Bild. Aber ich bekomme die Animation immer von drei verschiedenen Punkten, da es drei Tasten gibt. Bitte schau dir das Bild an, das erste Bild im Bild ist was ich will und das zweite Bild ist was ich bekomme! Bitte helfen! Android übersetzen Animation für verschiedene Tasten aus einzelnen (gleichen) Punkt
Im folgenden Codes:
TranslateAnimation tanim1 = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, -1f,
Animation.RELATIVE_TO_PARENT, 0);
tanim1.setDuration(700);
Zweiter Ansatz!
TranslateAnimation tanim = new TranslateAnimation(230, btn1.getX(), -height, btn1.getY());
TranslateAnimation tanim2 = new TranslateAnimation(230, btn2.getX(), -height, btn2.getY());
TranslateAnimation tanim3 = new TranslateAnimation(230, btn3.getX(), -height, btn3.getY());
Dritter Ansatz!
AnimatorSet animations = new AnimatorSet();
Animator xAnim = ObjectAnimator.ofFloat(button, "translationX", finalXValue);
xAnim.setDuration(3000);
Animator yAnim = ObjectAnimator.ofFloat(button, "translationY", finalYValue);
yAnim.setDuration(3000);
//Play all the animations together
animations.play(xAnim).with(yAnim);
Vielen Dank!