button向下移動(dòng)的代碼怎么寫
2 回答

Mopel
TA貢獻(xiàn)12條經(jīng)驗(yàn) 獲得超4個(gè)贊
button.animate().translationYBy(500f)//向下移動(dòng)距離 ????????.setDuration(1*1000)//動(dòng)畫持續(xù)時(shí)間 ????????.start();

微涼一季
TA貢獻(xiàn)44條經(jīng)驗(yàn) 獲得超97個(gè)贊
//向下移動(dòng),再移動(dòng)回來(lái)。 float?curTranslationY?=?button.getTranslationY();?? ObjectAnimator?animator?=?ObjectAnimator.ofFloat(button,?"translationY",?curTranslationY,?500f,?curTranslationY);?? animator.setDuration(5000);?? animator.start();
- 2 回答
- 0 關(guān)注
- 2133 瀏覽
添加回答
舉報(bào)
0/150
提交
取消