1
我想長時間按住滾動鍵「連接」,因此用戶不必釋放屏幕並開始滾動。帶滾動功能的Android長按
我已經姿態探測器實現...
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
public void onLongPress(MotionEvent e) {
// action 1
}
public boolean onScroll(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {
// action 2
}
}
public boolean onTouchEvent(MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
但現在動作1和動作2,用戶之間不得不釋放屏幕...我如何連接這個動作不釋放屏幕?
您onTouch(視圖V,MotionEvent事件)如果你想應該返回true處理ACTION_MOVE ...事件 – ebtokyo