Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

qml webview在iOS中无法显示本地html



  •    WebView
        {
            id:web
            anchors.centerIn: parent
            anchors.fill: parent
            url:Qt.platform.os === "android"?"file:///android_asset/data/map.html":"test.html";
            onLoadProgressChanged:
            {
               if(web.loadProgress == 100)
               {
                   var queryFun = "loadMap();"
                   web.runJavaScript(queryFun, function(result) { console.log(result); });
               }
            }
        }
    

    在Xcode本地test.html显示空白
    Xcode提示:
    2021-02-01 08:20:09.445040+0800 GstDebugWizard[367:11897] WF: === Starting WebFilter logging for process GstDebugWizard
    2021-02-01 08:20:09.445097+0800 GstDebugWizard[367:11897] WF: _userSettingsForUser mobile: {
    filterBlacklist = (
    );
    filterWhitelist = (
    );
    restrictWeb = 1;
    useContentFilter = 0;
    useContentFilterOverrides = 0;
    whitelistEnabled = 0;
    }
    2021-02-01 08:20:09.445137+0800 GstDebugWizard[367:11897] WF: _WebFilterIsActive returning: NO

    Xcode的定位、http请求权限已开。
    test.html代码如下:
    <font color = "red">TTTTTT</font>





  • 可以,学到了👏


Log in to reply