如何判断ScrollView滑动到最底部
2个回答
2015-05-30 · 知道合伙人互联网行家
关注
展开全部
应该需要集成一下scrollView 然后通过
int computeVerticalScrollOffset()
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range.
int computeVerticalScrollRange()
The scroll range of a scroll view is the overall height of all of its children.
if(getScrollY() + getHeight() >= computeVerticalScrollRange())
{
Log.d(TAG,"------滚动到最下方------");
}
else
{
Log.d(TAG,"没有到最下方");
}
int computeVerticalScrollOffset()
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range.
int computeVerticalScrollRange()
The scroll range of a scroll view is the overall height of all of its children.
if(getScrollY() + getHeight() >= computeVerticalScrollRange())
{
Log.d(TAG,"------滚动到最下方------");
}
else
{
Log.d(TAG,"没有到最下方");
}
2016-03-10 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
参考下面代码来实现:
//childView是scrollview里包含的Linearlayout容器
View childView = scrollView.getChildAt0);
if(mLastY == (childView.getHeight()-scrollView.getHeight())){ 此处if为判断条件
//滑动到底部
//TODO
}
//childView是scrollview里包含的Linearlayout容器
View childView = scrollView.getChildAt0);
if(mLastY == (childView.getHeight()-scrollView.getHeight())){ 此处if为判断条件
//滑动到底部
//TODO
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询