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

时间:2020-09-03  来源:中文酷站  阅读:

方法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

可以了,完美。。。。

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

http://m.bbyears.com/kuzhan/96357.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新