是否可以通过手指上下滑动或使用探索栏移动滚动条视图来获得滚动视图的位置和进度?
发布于 2013-06-25 03:10:58
参见代码示例:
...
yourLinearLayoutInScrollView.setOnTouchListener(new LayoutOnTouchListener());
...
private class LayoutOnTouchListener implements View.OnTouchListener {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
Point realTouchPosition = new Point(Math.round(motionEvent.getX() + view.getScrollX()), Math.round(motionEvent.getY() + view.getScrollY()));
return false;
}
}https://stackoverflow.com/questions/17282511
复制相似问题