15
有没有一种方法可以编辑内容以添加或通过Java从头开始创建?我一直无法找到任何例子。如何以编程方式设置/编辑webview的内容
有没有一种方法可以编辑内容以添加或通过Java从头开始创建?我一直无法找到任何例子。如何以编程方式设置/编辑webview的内容
您应该查看WebView文档here。
之间的信息还有其他大位,你会发现:
// OR, you can also load from an HTML string:
String summary = "<html><body>You scored <b>192</b> points.</body></html>";
webview.loadData(summary, "text/html; charset=utf-8", "utf-8");
// ... although note that there are restrictions on what this HTML can do.
// See the JavaDocs for loadData() and loadDataWithBaseURL() for more info.
非常接近页面的顶部。
WebView.loadData
可以传递一个直的HTML字符串。我使用在我的应用程序中从头开始创建的“页面”,该页面仅使用HTML格式编排