onInterceptTouch(MotionEvent)
为了允许水平滚动,我正在覆盖。然而,我发现我无法检测到用户何时触摸了嵌入的 v。视图上的 x、y 类似于 2000、2400,而视图上的 x、yMotionEvent.getX(),getY()
类似于 400,500
View v = findViewById(R.id.myView);
Rect r = new Rect();
v.getHitRect(r);
int[] loc = new int[2];
v.gtLocationOnScreen(loc);
int x = loc[0];
int y = loc[1];
// Result x,y are huge numbers 2400, etc
// event.getX() is 30, event.getY() == 500 nothing close to 2400.
if (r.contains((int)event.getX(), (int)event.getY())
{
return false; // this is never true even when I click right on View v.
}