本文整理了Java中com.tencent.smtt.sdk.WebView.getContentHeight()
方法的一些代码示例,展示了WebView.getContentHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.getContentHeight()
方法的具体详情如下:
包路径:com.tencent.smtt.sdk.WebView
类名称:WebView
方法名:getContentHeight
暂无
代码示例来源:origin: Justson/AgentWebX5
public static boolean isX5WebViewToBottom(com.tencent.smtt.sdk.WebView webview, int mTouchSlop) {
LogUtil.i("webview.getContentHeight() :"+webview.getContentHeight() +" getScale:"+webview.getScale()+" getHeight:"+webview.getHeight()+" webview.getScrollY:"+ webview.getScrollY()+" mTouchSlop:"+mTouchSlop+" (webview.getContentHeight() * webview.getScale() - (webview.getHeight() + webview.getScrollY())):"+(webview.getContentHeight() * webview.getScale() - (webview.getHeight() + webview.getScrollY()))+" 2 * mTouchSlop:"+(2 * mTouchSlop)+" getY:"+webview.getY()+" getWebScrollY:"+webview.getWebScrollY()+" getPivotY :"+webview.getPivotY()+" getTranslationY:"+webview.getTranslationY());
return webview != null && ((webview.getContentHeight() * webview.getScale() - (webview.getHeight() + webview.getWebScrollY())) <= 2 * mTouchSlop);
}
代码示例来源:origin: linxin6560/DetailScrollView
@Override
public boolean onPreDraw() {
WebView webView = (WebView) mWebView;
webView.getGlobalVisibleRect(outRect);
int distBottom = DetailScrollView.this.getHeight() - outRect.height();
if (distBottom <= 0
|| DetailScrollView.this.getScrollY() == 0//没触发滑动的时候不扩展
|| webView.getHeight() < DetailScrollView.this.getHeight())//webView本身高度就小于scrollview,也不扩展
return true;
int newWebViewContentHeight = webView.getContentHeight();
if (mOldWebViewContentHeight == newWebViewContentHeight)
return true;
mOldWebViewContentHeight = newWebViewContentHeight;
ViewGroup.LayoutParams lp = webView.getLayoutParams();
lp.height = webView.getMeasuredHeight() + distBottom;
webView.setLayoutParams(lp);
return true;
}
});
内容来源于网络,如有侵权,请联系作者删除!