【问题标题】:webview not work for local html file in coronawebview 不适用于电晕中的本地 html 文件
【发布时间】:2015-02-06 17:46:07
【问题描述】:
local webView = native.newWebView( 0, 50, 320, 430 )
webView.anchorX = 0;
webView.anchorY = 0;
print("***************************************files/");
print("files/"..data[1].name..".html");
local htmlFile = "files/"..data[1].name..".html"

--Ancient Egypt
webView:request( "files/"..data[1].name..".html", system.ResourceDirectory );
webView:addEventListener( "urlRequest", webListener );

我必须在电晕中使用,然后它不会打开我的本地 html 文件。电晕如何使用更好?

【问题讨论】:

    标签: lua coronasdk


    【解决方案1】:

    模拟器不支持 webView。

    在您的代码目录中使用“文件”文件夹构建应用程序时,也可以尝试简单地使用以下内容:

    webView:request( "files/"..data[1].name..".html");
    

    而不是

    webView:request( "files/"..data[1].name..".html", system.ResourceDirectory );
    

    尝试使用 data[1] 而不是 data[1].name 来查看它是否返回正确的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-11
      • 1970-01-01
      • 2012-07-30
      • 2018-03-28
      • 1970-01-01
      • 1970-01-01
      • 2011-03-28
      • 1970-01-01
      相关资源
      最近更新 更多