简体   繁体   English

WebView,在ICS中显示空白

[英]WebView, showing blank in ICS

I am loading a local HTML document kept in assets folder into a WebView . 我正在将保存在assets文件夹中的本地HTML文档加载到WebView It is showing fine in 2.3 devices but, showing blank screen in ICS + devices. 它在2.3设备中显示良好,但在ICS +设备中显示空白屏幕。

Try using this code 尝试使用此代码

webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setAllowFileAccess(true);

As per my knowledge flash url do not work in ICS. 根据我的知识,flash url在ICS中不起作用。

This code should work 这段代码应该有效

webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.loadUrl(url);
weevils.setJavascriptEnabled(true);

Also check that the internet permission in declared in your manifest.xml And take a look at this thread which is quite similar: Android Webview not rendering correctly on ICS 4.0 + 还要检查manifest.xml中声明的internet权限并查看这个非常相似的线程: Android Webview无法在ICS 4.0 +上正确呈现

try adding this code if the above answer does not solve the problem 如果上述答案无法解决问题,请尝试添加此代码

webView.getSettings().setBuiltInZoomControls(false);

I an not too sure on this though. 我对此不太确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM