【发布时间】:2014-02-13 17:15:57
【问题描述】:
我将一些内容显示到一个以<p> 开头并以</p> 标记结尾的 web 视图中。我正在通过 loadDataWithBaseURL 将内容加载到 webview 并尝试在中间显示内容:
public static String contentPrefix = "<html><head><style type='text/css'>#content_wrapper {position: relative; margin: 0px auto;} </style></head><div id='content_wrapper'>";
public static String contentPostfix = "</div></html>";
webView.loadDataWithBaseURL("", contentPrefix + result + contentPostfix, "text/html", "UTF-8", "");
但它不起作用。我应该怎么做才能在中间显示这些内容?
【问题讨论】: