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);

相关文章:

  • 2021-09-16
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-04-06
  • 2022-12-23
  • 2021-05-10
  • 2022-02-20
  • 2021-12-25
  • 2021-10-21
  • 2021-06-24
相关资源
相似解决方案