我的真实html:
<div class=\"stl_01\" style=\"top: 64.3574em; left:32.3889em;\">
<span class=\"stl_13 stl_10\" style=\"word-spacing:0.05em;\">Sign:</span>
<span class=\"stl_23 stl_10\" style=\"word-spacing:0em;\">______________"
<span class=\"stl_15\">_______ </span></span></div>
我要替换:
<div class=\"stl_01\" style=\"top: 64.3574em; left:32.3889em;\">
<span class=\"stl_13 stl_10\" style=\"word-spacing:0.05em;\">Sign:</span>
<img src= "getResources().getDrawable(R.drawable.bg_button_blue) " />
</div>
我的代码:
web.loadData("<html><body> " + result.getHtmltext().replaceAll("<div class=\"stl_01\" style=\"top: 64.3574em; left:32.3889em;\">\n" +
"<span class=\"stl_13 stl_10\" style=\"word-spacing:0.05em;\">Sign:</span>" +
"<span class=\"stl_23 stl_10\" style=\"word-spacing:0em;\">______________" +
"<span class=\"stl_15\">_______ </span>" +
"</span>" +
"</div>",
"<div class=\"stl_01\" style=\"top: 64.3574em; left:32.3889em;\">" +"<span class=\"stl_13 stl_10\" style=\"word-spacing:0.05em;\">Sign:</span>" +"<img src=" + getResources().getDrawable(R.drawable.bg_button_blue) + "/>"+
"</div>" + "Hello") + "</body></html>", "text/html; charset=UTF-8", null);
但是它不起作用。这是正确的吗?还是这是错误的?我可以替换这样的文本吗?还是怎么更换?帮我。谢谢你们