我已經用image實現了一個應用程序。在我的應用程序中,當用戶觸摸圖像時,我使用圖像,我想用手指觸摸移動圖像。我已經實現我的應用程序如下:如何在用戶觸摸事件時在xml佈局上移動圖像?
((ImageView)findViewById(R.id.imageView1)).setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
//I would like to Move image along with user finger touch code
break;
default:
break;
}
return false;
}
});
從上面的代碼我不能移動圖像與用戶手指一起。
-1這應該是[帶鏈接的評論](http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links -elsewhere - 真的好 - 答案)。 – 2012-03-10 06:05:27