ScrollView滚动到底部使用的scrollTo和fullScroll方法的异同
答案:2 悬赏:30 手机版
解决时间 2021-01-29 21:58
- 提问者网友:遮云壑
- 2021-01-29 02:30
ScrollView滚动到底部使用的scrollTo和fullScroll方法的异同
最佳答案
- 五星知识达人网友:零点过十分
- 2021-01-29 03:21
* method will scroll the view to the top or bottom and give the focus
* to the topmost/bottommost component in the new visible area. If no
* component is a good candidate for focus, this scrollview reclaims the
* focus.</p>
*
* @param direction the scroll direction: {@link android.view.View#FOCUS_UP}
* to go the top of the view or
* {@link android.view.View#FOCUS_DOWN} to go the bottom
* @return true if the key event is consumed by this method, false otherwise
*/
public boolean fullScroll(int direction) {
boolean down = direction == View.FOCUS_DOWN;
int height = getHeight();
* to the topmost/bottommost component in the new visible area. If no
* component is a good candidate for focus, this scrollview reclaims the
* focus.</p>
*
* @param direction the scroll direction: {@link android.view.View#FOCUS_UP}
* to go the top of the view or
* {@link android.view.View#FOCUS_DOWN} to go the bottom
* @return true if the key event is consumed by this method, false otherwise
*/
public boolean fullScroll(int direction) {
boolean down = direction == View.FOCUS_DOWN;
int height = getHeight();
全部回答
- 1楼网友:人類模型
- 2021-01-29 04:40
o和fullscroll两个方法经常被用来做滚动到底部的操作
不过就这个功能而言 也是有不同之处的
使用fullscroll滚动到底部 使用的参数为 focus_down 顾名思义 和 焦点有关
fullscroll 代码如下
/**
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯