안드로이드 개발 질문/답변
(글 수 45,052)
드로잉 기능이 포함된 커스텀 뷰를 따로 생성하여 Adapter를 이용하여 ListView로 계속 페이지를 늘리는 기능을 구현하려고 합니다.
그런데 페이지가 늘어나기 때문에 스크롤 기능이 들어가는데 스크롤과 드로잉 기능을 나누려고하는데 뜻대로 안되네요
원래 페이지를 늘리기 전에는 드로잉이 잘 되었던 소스입니다. 하지만 페이지를 늘리면서 세로로 드로잉을 하면 자꾸
MotionEvent.ACTION_CANCEL 이 실행되네요 원인과 해결 방법을 알았으면 합니다.
@Override
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Log.d("SCROLL","ACTION_DOWN!!!!!");
touch_start(x,y);
mPathException = true;
break;
case MotionEvent.ACTION_MOVE:
Log.d("SCROLL","ACTION_MOVE!!!!!");
touch_move(x,y);
break;
case MotionEvent.ACTION_UP:
Log.d("SCROLL","ACTION_UP!!!!!");
if(btouch_move_Draw){
Log.d("SCROLL","ACTION_UP!!!!!" + btouch_move_Draw);
touch_up(x,y);
mPathException = false;
}
break;
case MotionEvent.ACTION_CANCEL:
Log.d("SCROLL","ACTION_CANCEL!!!!!");
}
return true;
}




리스트에서 해당 드로잉 이벤트를 먹는거겠져...
이벤트를 가로채는 방법을 써보세요......