是否可以通过使用手指上下滑动或通过使用seekbar移动滚动条视图来获取滚动条的位置和进度?
See code example:
...
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;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.