wbPayDetail = (WebView) headerView .findViewById(R.id.wbPayDetail);
// wbPayDetail.getSettings().setBlockNetworkImage(true); //图片加载不加渲染
// wbPayDetail.getSettings().setFixedFontFamily(Context.LAYOUT_INFLATER_SERVICE);
// wbPayDetail.getSettings().setJavaScriptEnabled(true);
// wbPayDetail.getSettings().setUseWideViewPort(true);//当false时,此WebView的宽度始终是Web页面CSS中控制的宽度,因此要适配屏幕此方法要为true。
//wbPayDetail.getSettings().setLayoutAlgorithm( WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
//wbPayDetail.setVerticalScrollBarEnabled(false);
//wbPayDetail.setVerticalScrollbarOverlay(false);
//wbPayDetail.setHorizontalScrollBarEnabled(false);
//wbPayDetail.setHorizontalScrollbarOverlay(false);
wbPayDetail.getSettings().setDefaultFontSize(15);
wbPayDetail.getSettings().setLoadWithOverviewMode(true);// 这种加载模式,是缩小内弄以适配屏幕宽度
wbPayDetail.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);
wbPayDetail.setBackgroundColor((Color.parseColor("#474546")));
wbPayDetail.getBackground().setAlpha(2); // 设置填充透明度 范围:0-255
wbPayDetail.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return true;
}
@Override
public void onPageFinished( WebView view, String url) {
super.onPageFinished(view, url);
}
});
原文链接:http://www.apkbus.com/blog-610699-58673.html
打开App,阅读手记