【webview加载html标签中文乱码解决方法】WebView加载html标签中文乱码解决办法

更新时间:2020-09-03    来源:中文酷站    手机版     字体:

【www.bbyears.com--中文酷站】

方法1:

String html="

我是测试用的标签

";
webView.loadData(html, "text/html", "utf-8");
效果如下:

lALOCsTfs80FAM0C0A_720_1280

 

啊嘞。乱码了。。试试下面的方法

方法2:

 String html="

我是测试用的标签

";
// webView.loadData(html, "text/html", "utf-8");
 webView.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);
效果如下:

lALOCsUyIc0FAM0C0A_720_1280

可以了,完美。。。。

本文来源:http://www.bbyears.com/kuzhan/96357.html

热门标签

更多>>

本类排行