Android webview不显示'%'字符(Android webview not displaying '%' character)

编程入门 行业动态 更新时间:2024-10-26 05:32:28
Android webview不显示'%'字符(Android webview not displaying '%' character)

我有一个使用以下代码的WebView :

WebView webView = new WebView(cont); webView.loadData("Red 20%", "text/html", "utf-8");

显示字符串时遇到问题。 但是如果我从字符串中删除'%'字符就会正确显示。 代码有什么问题? 如何在WebView显示'%'?

I have a WebView using following code:

WebView webView = new WebView(cont); webView.loadData("Red 20%", "text/html", "utf-8");

It is having trouble showing the string. But if I remove the '%' character from the string it is showing properly. What is wrong with the code? How do I display '%' in WebView?

最满意答案

简单:

WebView webView = new WebView(cont); webView.loadData("Red 20%", "text/html", "utf-8");

您可以在此处查看特殊字符: http : //www.degraeve.com/reference/specialcharacters.php

Simple:

WebView webView = new WebView(cont); webView.loadData("Red 20%", "text/html", "utf-8");

You can see the special characters here: http://www.degraeve.com/reference/specialcharacters.php

更多推荐

本文发布于:2023-07-31 00:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340388.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符   webview   Android   displaying   character

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!