是否可以通过手指向上或向下滑动或使用搜索栏移动滚动条视图来获取滚动视图位置和进度?
答案 0 :(得分:0)
参见代码示例:
...
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;
}
}