Android中ScrollView滚动到顶部或者底部的方法
分类:Android, Java
阅读 (1,357)
Add comments
7月 192017
滚动到底部:
1 2 3 4 5 6 |
mRootScrollView.post(new Runnable() { @Override public void run() { mRootScrollView.fullScroll(ScrollView.FOCUS_DOWN); } }); |
滚动到顶部:
1 2 3 4 5 6 |
mRootScrollView.post(new Runnable() { @Override public void run() { mRootScrollView.fullScroll(ScrollView.FOCUS_UP); } }); |