I have an ImageView that is 250dp above the bottom, and with the translation of the animation I want to move it 50dp above the bottom.
I know how to use translational animation, but I don’t know what the ToYValue field was.
The wil code would be something like this:
TranslateAnimation translate = new TranslateAnimation(Animation.RELATIVE_TO_PARENT,0,Animation.RELATIVE_TO_PARENT,0,Animation.ABSOLUTE,250,Animation.ABSOLUTE,50);
translate.setDuration(1000);
translate.reset();
translate.setFillAfter(true);
iv.clearAnimation();
iv.startAnimation(translate);
source
share