【发布时间】:2018-03-14 03:10:19
【问题描述】:
由于我是 Qt ios 开发的新手,我不知道将捆绑数据文件称为 Webview 的 url。
注意:: Webview 不支持 url 的资源系统。
以qt minibrwoser 为例进行实施。
Update in .pro file, Added html_file folder as Bundle data:
ios {
deployment.files = $${PWD}\\html
deployment.path =
QMAKE_BUNDLE_DATA += deployment
}
Update in main.qml file
WebView {
id: webView
anchors.fill: parent
url: "file:assets-library:/assest/html/view.html"
//url didn't load on runtime (not sure how to access bundle data html file at runtime)
onLoadingChanged: {
if (loadRequest.errorString)
console.error(loadRequest.errorString);
}
}
我可以通过以下代码更新访问 android 中的同一页面:
WebView {
id: webView
anchors.fill: parent
url: "file:///android_asset/html/view.html"
onLoadingChanged: {
if (loadRequest.errorString)
console.error(loadRequest.errorString);
}
}
问题::如何在ios中调用bundle_data文件作为url?
如果有人遇到类似问题并知道解决方案。请指导我解决。
【问题讨论】: