button向下移动的代码怎么写
2 回答

Mopel
TA贡献12条经验 获得超4个赞
button.animate().translationYBy(500f)//向下移动距离 .setDuration(1*1000)//动画持续时间 .start();

微凉一季
TA贡献44条经验 获得超97个赞
//向下移动,再移动回来。 float curTranslationY = button.getTranslationY(); ObjectAnimator animator = ObjectAnimator.ofFloat(button, "translationY", curTranslationY, 500f, curTranslationY); animator.setDuration(5000); animator.start();
- 2 回答
- 0 关注
- 2089 浏览
添加回答
举报
0/150
提交
取消