-2
我想在單擊某個按鈕時將圖像視圖從一個點移動到另一個點。將圖像視圖從點移動到另一個
這裏是我的代碼:
int e = 0 ;
Button d = (Button)findViewById(R.id.button1);
d.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
TranslateAnimation move = new TranslateAnimation(e, e + 1, e, e + 1);
move.setDuration(1000);
move.setFillAfter(true);
image.startAnimation(move);
}
});
但是當我點擊該按鈕什麼都沒有發生! 如何讓它工作?
我將其更改爲10,它會移動,謝謝 – Cleopatra