javascript - 如何在 appcelerator Titanium 中将 WKWebView 与本地文件一起使用?
问题描述
我尝试将新的 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 项目的项目 Resources 目录或 Alloy 项目的 app/assets 和 app/lib 目录的。
推荐阅读
- c++ - 摩尔斯电码转英文的作用是什么?
- mongodb - Mongo Go 驱动程序 - 内联嵌入式结构不起作用
- python - 在 Python 中覆盖 Azure Blob 的最佳方法
- php - 如何使用 PHP 将此 xml 数据放入 mySQL
- git - 无法通过 SSH 克隆 Azure DevOps 存储库,需要密码
- javascript - javascript 仅在我添加第二个 getElementbyId 时才连接数字
- go - 当原始 arg 是指针时如何转换类型
- javascript - 按钮单击后引导模式变为空白
- node.js - 由于配置错误,执行失败:Node JS Lambda 中的 Lambda 代理响应格式错误
- flutter - Flutter 在对象列表中获取值