是否可以通过手指上下滑动或使用 seekbar 移动滚动条视图来获取滚动视图的位置和进度?
问问题
347 次
1 回答
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;
}
}
于 2013-06-24T19:10:58.240 回答