0
是否可以通過手指上下滑動或用seekbar移動滾動條視圖來獲得滾動視圖的位置和進度?用seekbar和手指滾動滾動視圖android
是否可以通過手指上下滑動或用seekbar移動滾動條視圖來獲得滾動視圖的位置和進度?用seekbar和手指滾動滾動視圖android
見代碼例如:
...
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;
}
}