WebView, showing blank in ICS

ぐ巨炮叔叔 提交于 2019-12-12 14:02:41

问题


I am loading a local HTML document kept in assets folder into a WebView. It is showing fine in 2.3 devices but, showing blank screen in ICS + devices.


回答1:


Try using this code

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

As per my knowledge flash url do not work in ICS.




回答2:


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 +




回答3:


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.



来源:https://stackoverflow.com/questions/13155800/webview-showing-blank-in-ics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!