Weird miscalculation when trying to detect if WebView scrolled to bottom

后端 未结 2 1981
庸人自扰
庸人自扰 2020-12-19 19:50

I have a problem detecting when WebView is scrolled to bottom. I use following code:

@Override
protected void onScrollChanged(int x, int y, int          


        
2条回答
  •  太阳男子
    2020-12-19 20:13

    Got the exact result with following:

    @Override
    protected void onScrollChanged(int x, int y, int oldX, int oldY) {
        super.onScrollChanged(x, y, oldX, oldY);
    
        if (y == computeVerticalScrollRange() - getHeight()) {
            // Trigger listener
        }
    }
    

提交回复
热议问题