WebView

作者: Simple_is_Best | 来源:发表于2018-04-26 15:21 被阅读6次

1、webview切换地址导致网页留白问题,需在onPageStarted方法中获取网页的高度,重新设置给webview(注意宽度也要设置)


webView.loadUrl("javascript:app.resize(document.body.getBoundingClientRect().height)");

webView.setLayoutParams(new LinearLayout.LayoutParams(ScreenUtils.getScreenWidth(),(int) (height * getResources().getDisplayMetrics().density)));

相关文章

网友评论

      本文标题:WebView

      本文链接:https://www.haomeiwen.com/subject/juxmlftx.html