具有IFRAME android的WebView [英] WebView with an IFRAME android

查看:169
本文介绍了具有IFRAME android的WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在WebView内加载HTML <IFRAME>,但是我不知道为什么,它不能这样做.

I want to load an HTML <IFRAME> inside an WebView, but I don't know why, it is not able to do so.

我正在使用以下代码加载<IFRAME>

I am using following code to load <IFRAME>

webView.loadData("<iframe src=\"http://www.google.com\"></iframe>", "text/html",
                "utf-8");

这就是我尝试过的.

WebSettings webViewSettings = webView.getSettings();
webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webViewSettings.setJavaScriptEnabled(true);
webViewSettings.setPluginsEnabled(true);
webViewSettings.setBuiltInZoomControls(true);
webViewSettings.setPluginState(PluginState.ON);

我提到了互联网许可:

<uses-permission android:name="android.permission.INTERNET" />

我还尝试将WebViewClient设置为shouldOverrideUrlLoading总是返回false.

I have also tried settings the WebViewClient with shouldOverrideUrlLoading always returning false.

但是它不起作用.

我已经在其他网站(即google.com以外的其他网站)上尝试过此操作.

I have tried this with diffrent sites, i.e. sites other than, google.com.

我正在运行ICS 4.0.3的Samsung Nexus S上对此进行测试

I am testing this on, Samsung Nexus S running ICS 4.0.3

推荐答案

这是它的工作方式.

我注意到原木猫把我扔了

I noticed Log cat was throwing me

WebKit权限问题:EventHub.removeMessages(int what = 107)是 设置WebViewCore之前不支持

WebKit permission issue: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up

要解决此问题,我必须在清单的<application>标签中添加android:hardwareAccelerated="true".

To fix this, I had to add android:hardwareAccelerated="true" in <application> tag of Manifest.

我在ICS上遇到了这个问题,发现在Honeycomb设备之后也会出现同样的问题.

I was experiencing this on ICS and its found that the same issue will occur post Honeycomb devices.

希望这会帮助一些人.

这篇关于具有IFRAME android的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆