【发布时间】:2013-01-04 04:24:38
【问题描述】:
我使用 Titanium Appcelerator 创建了一个应用程序,在该应用程序中我使用 web 视图来显示一些网页。在 webview 中显示的所有网页都启用了 HTML5 缓存,因为我希望即使应用程序脱机运行,这些网页也可用。
我面临的问题是,当没有网络连接时,webview 无法显示缓存的网页。但是我已经在浏览器中测试了所有网页,并且它们都可以正常工作。
我在 Android 平台上遇到了这个问题。
这是网页视图的代码:
//FirstView Component Constructor
function FirstView() {
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView();
var webview = Ti.UI.createWebView({
url: 'http://www.w3schools.com/html/tryhtml5_html_manifest.htm'
});
self.add(webview);
return self;
}
module.exports = FirstView;
这个网址在浏览器中运行良好。我该如何解决这个问题?
【问题讨论】:
标签: android html caching webview titanium