android - 如何使 android WebView 加载速度更快?

标签 android android-webview

有人有一些建议可以让 webview 更快地加载 url 吗?

在我的情况下,我使用 jQuery 的 getScript 在需要时加载 javascript。

谢谢, 萨那。

最佳答案

这可能不适合您的情况,但您可以忽略加载图片。

       webview.getSettings().setBlockNetworkImage(true);

如果目标是 api 级别 8 (2.2) 或更高级别,您可以更进一步

       webview.getSettings().setBlockNetworkLoads(true);

更多:WebSettings | Android Developers

关于android - 如何使 android WebView 加载速度更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3729968/

相关文章:

android - 无法访问 genymotion 相机?

android - 以编程方式设置 Imageview 的高度和宽度

android - Android 中带有对话框和 wevView 的泄漏窗口

Android imageview 色调

android - 替换 fragment : Previous view remains Active in the background?

android - 在 Android 设备本地托管 HTML 页面

Android Webview 视口(viewport)问题

android - WebView 视频不在 Android 2.3 中播放

android - 基于 LibGdx 的 Android 应用程序中指定区域的 WebView

android - 如何删除从 Google Play 服务库中导入的未使用的 Google+ 图标