我想为我的视图检测 onTouchEvent 函数中的触摸边缘,但 getEdgeFlags() 在我的 Nexus S 4.1.1 中总是返回 0,有人可以帮助我吗?提前谢谢。
@Override
public boolean onTouchEvent(MotionEvent event) {
int edgeFlags = event.getEdgeFlags();
//edgeFlags alway 0!
switch (edgeFlags) {
case MotionEvent.EDGE_LEFT:
Log.i("tag", "EDGE_LEFT");
break;
case MotionEvent.EDGE_RIGHT:
Log.i("tag", "EDGE_RIGHT");
break;
case MotionEvent.EDGE_TOP:
Log.i("tag", "EDGE_TOP");
break;
case MotionEvent.EDGE_BOTTOM:
Log.i("tag", "EDGE_BOTTOM");
break;
default:
Log.i("tag", "" + edgeFlags);
break;
}
return super.onTouchEvent(event);
}