webview iframe显示空白或黑屏?

时间:2013-03-28 11:00:45

标签: android iframe webview mobile-devices

webview.setVisibility(View.VISIBLE);
webview.getSettings().setJavaScriptEnabled(true);
//webview.getSettings().setPluginsEnabled(true);
webview.getSettings().setPluginState(PluginState.ON);
webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
webview.getSettings().setAllowFileAccess(true);
webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setBlockNetworkLoads(false);
webview.setWebChromeClient(new WebChromeClient() {});

final String mimeType = "text/html";
final String encoding = "UTF-8";
String html = getHTML1();
webview.loadDataWithBaseURL("", html, mimeType, encoding, "");
}

public String getHTML1() {
    Log.d("trailer_2 HTML","ok");
    String html = "<iframe class=\"youtube-player\" style=\"border:0;
    width: 100%; height:96%; padding:0px; 
    margin:0px\"id=\"ytplayer\" type=\"text/html\" src=\"http://www.youtube.com/embed/"
            + "H7Ht-m2QMDY"
            + "?fs=0\" frameborder=\"0\">\n"
            + "</iframe>\n";
 return html;
}

我尝试了很多。它适用于平板电脑设备但不适用于移动设备?  我还提到清单bur中的hardwareAcelator=true无效?

0 个答案:

没有答案