【问题标题】:iframe ng-attr-srcdoc not working in lower versions of android( 4.3 and below)iframe ng-attr-srcdoc 在较低版本的 android(4.3 及更低版本)中不起作用
【发布时间】:2015-05-05 10:28:38
【问题描述】:
我正在使用 iframe 来显示我的 htmlResponse(angularjs 嵌入的 html)。它在 android 4.4 及更高版本中正常工作。但在较低版本中,它不会被渲染。
这就是我在我的 html 中提到 iframe 的方式
<iframe width="100%" height="500px" ng-attr-srcdoc="{{htmlResponse}}"></iframe>
有人可以帮我解决这个问题吗?
【问题讨论】:
标签:
javascript
android
angularjs
iframe
ionic-framework
【解决方案1】:
在 android 中使用 Webview。在 webview 中使用 loaddata()。
String doc = "<iframe src='' width='100%' height='100%' style='border: none;'></iframe>";
webview.loadData(doc, "text/html", "UTF-8");
希望这会有所帮助...