标签:smo get pre off 定位 bsp col 底部 SM
1.固定到顶部
scroll_view.requestFocusFromTouch();
scroll_view.setScrollX(0);
2.固定到指定位置
int[] location = new int[2];
titleTwo.getLocationOnScreen(location);
int offset = location[1] - mRootScrollView.getMeasuredHeight();
if (offset < 0) {
offset = 0;
}
mRootScrollView.smoothScrollTo(0, offset);
滚到到底部:
mRootScrollView.fullScroll(ScrollView.FOCUS_DOWN);
滚动到顶部:
mRootScrollView.fullScroll(ScrollView.FOCUS_UP);
标签:smo get pre off 定位 bsp col 底部 SM
原文地址:https://www.cnblogs.com/dubo-/p/9078142.html