0
ImageView currentImage = (ImageView) findViewById(R.id.image) ;
onTouch(View v, MotionEvent event){
if(event.getAction() == MotionEvent.ACTION_DOWN){
float x = event.getX() ;
float y = event.getY();
currentImage.setX(x) ;
currentImage.setY(y) ;
//the 2 lines above must be dragging the image across the screen
}
if(event.getAction() == MotionEvent.ACTION_UP){
currentImage.setX(x) ;
currentImage.setY(y) ;
}
}如何按并拖动和离开的ImageView其中i未按我的手指?[机器人]
但是,代码不工作,这是最接近我能想出。
您是否找到了解决方案? – Sree