我试图像这样使用WebView:
String html = " <html><body>
<table style\"background-color: #0a82a4; color: #ffffff;\">
... stuff ...
</table>"
</body>
</head>";
html.replace("#", "%23");
html.replace("\\", "%27");
html.replace("?", "%3f");
html.replace("%", "%25");
myWebview.loadData(html, "text/html", "utf-8");
可行,但在样式标记中添加width = 100%时,webView无法加载数据。
loll,已解决:
html = html.replace("%", "%25");
html = html.replace("#", "%23");
html = html.replace("\\", "%27");
html = html.replace("?", "%3f");
答案 0 :(得分:1)
为了解决这个问题,我改变了替换呼叫的顺序:
html = html.replace("%", "%25");
html = html.replace("#", "%23");
html = html.replace("\\", "%27");
html = html.replace("?", "%3f");
答案 1 :(得分:0)
您是否在位于here
的devguide中看到了HelloWorld示例