Android将html数据加载到chrome自定义标签中

时间:2016-11-11 16:19:46

标签: android html webview google-chrome-devtools

我想在我的应用中使用Chrome自定义标签。我发现如何将数据从url加载到选项卡中,但我没有找到,如何使用html-tags从字符串值加载数据。如何从webview示例中进行类似的功能:

webViewContent.loadDataWithBaseURL(null, htmlText, "text/html", "UTF-8", null);

在chrome自定义标签中?

1 个答案:

答案 0 :(得分:0)

无法直接将HTML字符串或包含file://网址的本地HTML文件加载到Chrome自定义标签中。

但是您可以实现本地服务器以在“自定义镶边”标签中呈现脱机html内容。请参阅以下URL。

https://bitbucket.org/snippets/pkumarad/qAk6x