String content = String.format("%s%s%s", "<html><head><meta http-equiv=\"Content-Type\"content=\"text/html\" charset=\"UTF-8\" /><meta name=\"keywords\" content=\"webview Android\"/></head><body>",detail,"</body></html>");
wvContent.loadDataWithBaseURL(content, "text/html", "utf-8"); 错误的
正确的显示方式:
wvContent.loadDataWithBaseURL(null,content, "text/html", "utf-8",null);
WebView wvContent = (WebView) findViewById(R.id.wv_content);
WebSettings ws = wvContent.getSettings();
ws.setJavaScriptEnabled(false);
ws.setAllowFileAccess(true);
ws.setBuiltInZoomControls(false);
ws.setSupportZoom(false);
ws.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN );
ws.setDefaultTextEncodingName("utf-8"); //设置文本编码
ws.setAppCacheEnabled(true);
ws.setCacheMode(WebSettings.LOAD_DEFAULT);//设置缓存模式</span>