ObjectAnimator animator=ObjectAnimator.ofFloat(textView,View.Y,0,100);
ObjectAnimator animator=ObjectAnimator.ofFloat(textView,View.TRANSLATION_Y,0,100);
这两者的区别在于,Y是绝对位置,TRANSLATION_Y是相对位置,跟它定义在布局中的位置有关。
ObjectAnimator animator=ObjectAnimator.ofFloat(textView,View.Y,0,100);
ObjectAnimator animator=ObjectAnimator.ofFloat(textView,View.TRANSLATION_Y,0,100);
这两者的区别在于,Y是绝对位置,TRANSLATION_Y是相对位置,跟它定义在布局中的位置有关。