[英]Appcelerator Titanium: How to use the onLoad event of an Window?
[英]How to use WKWebView with local file in appcelerator Titanium?
我嘗試將新的 WKWebview 與 appcelerator 的本地 URL 一起使用
var WK = require('ti.wkwebview');
var webview = WK.createWebView({
url:'about.html',
});
win.add(webview);
我的 about.html 文件在根文件夾中,HTML 代碼是:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Page</title>
</head>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">
<p align="center"><img src="images/DefaultIcon.png" alt="" width="50" height="50" border="0"></p>
<p align="center"><b>Text to test thanks</p>
<br/>
</html>
但是頁面不顯示。 我不明白為什么。 任何的想法 ?
url 屬性在引用本地 Web 內容時使用的路徑相對於 Titanium 項目的項目資源目錄,或 Alloy 項目的 app/assets 和 app/lib 目錄。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.