2013-10-21 5 views

답변

2

내가 활동을 확장하기 위해 필요한이 예를 들어이 링크 How to draw a line in android

+0

에 따라

@Override public boolean onTouchEvent (MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { start_x = event.getX(); start_y = event.getY(); } else if (event.getAction() == MotionEvent.ACTION_MOVE) { //create the line from start_x and start_y to the current location //don't forget to invalidate the View otherwise your line won't get redrawn } else if (event.getAction() == MotionEvent.ACTION_UP) { //might not need anything here } 

를 끌어과 드로우 라인이 코드는 터치 이벤트에 따라 또는보기? – Uday

+0

활동을 확장하고 OnTouchlistner를 구현해야합니다. – Indra

관련 문제