2016-06-18 15 views

答えて

1

これを処理する最も簡単な方法は、私は簡単に私が探しています何を実装するには、これらのイベントの例を使用することができますView.OnTouchListener

@Override 
public boolean onTouch(View v, MotionEvent event) 
{ 
    float x = event.getX(); 
    float y = event.getY(); 

    switch(event.getAction()) 
    { 
     case MotionEvent.ACTION_DOWN: 
      // A pressed gesture has started, the motion contains the initial starting location. 
      break; 

     case MotionEvent.ACTION_MOVE: 
      // A change has happened during a press gesture (between ACTION_DOWN and ACTION_UP). 
      break; 

     case MotionEvent.ACTION_UP: 
      // A pressed gesture has finished, the motion contains the final release location 
      // as well as any intermediate points since the last down or move event. 
      break; 

    } 
    return false; //True if the listener has consumed the event, false otherwise. 
} 
+0

を実装することであろう。ありがとう! –

関連する問題