检测,如果web视图滚动到达终点 [英] Detect if Webview scroll reach the end

查看:116
本文介绍了检测,如果web视图滚动到达终点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出在最大滚动的立场,即的WebView 能达到,我已经试过了 web视图.pageDown(真)但结果被延迟(我不能滚动下来,然后由用户盈,而这种方法不能每次都工作),我也试着 webView.getContentHeight(),高度是不正确的阿拉伯语的内容。

am trying to figure out the max scroll position that the WebView can reach, i've tried the webView.pageDown(true) but the result is delayed ( i cant scroll it down, then up infront of the user, and this method doesn't work every time), i've tried also webView.getContentHeight() and the height isn't correct for Arabic content.

请咨询

推荐答案

好吧,我想出了答案

您可以用得到真正的内容高度

you can get the real content height using

(int)的Math.floor(webView.getContentHeight()* webView.getScale());

(int) Math.floor(webView.getContentHeight() * webView.getScale());

当你得到真正的高度,那么就重写滚动方法的WebView听滚动事件,如果滚动达到真正的高度,你的web视图是滚动的底部。

when you get the real height, then just override the scroll method in webview to listen to scroll event, if the scroll reach the real height, your webview is in the bottom of the scroll.

这篇关于检测,如果web视图滚动到达终点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆