我已经用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