判斷scrollview是否滾動到了底部

調用函數判斷以下:
if(getScrollY() + getHeight() >=  computeVerticalScrollRange())
{
        Log.d(TAG,"------滾動到最下方------");
}
else
{
        Log.d(TAG,"沒有到最下方");
}

或:重寫ScrollView
protected void onScrollChanged(int l, int t, int oldl, int oldt)
{
用t代替上面的getScrollY(),也能夠,他們的值相同
....
}html

 

參考自: http://blog.chinaunix.net/uid-20782417-id-1645164.html函數

相關文章
相關標籤/搜索