Giusy Active Member Licensed User Sep 2, 2018 #1 Hi, I load html file with this code: Code: Copy stringa="myfile.html" WebView1.Loadurl("file://" & File.Combine(File.DirAssets, stringa)) panelWEB.AddView(WebView1, 0, 0, panelWEB.Width, panelWEB.Height) In debug mode it work very well, but in release mode (Tools-Build Server - Buil release app) I have a white page. How to correct the error? Thanks
Hi, I load html file with this code: Code: Copy stringa="myfile.html" WebView1.Loadurl("file://" & File.Combine(File.DirAssets, stringa)) panelWEB.AddView(WebView1, 0, 0, panelWEB.Width, panelWEB.Height) In debug mode it work very well, but in release mode (Tools-Build Server - Buil release app) I have a white page. How to correct the error? Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2018 #2 Better code: Code: Copy Dim xui As XUI WebView1.LoadUrl(xui.FileUri(File.DirAssets, stringa)) Are you referencing other resources in this html string? Upvote 0
Better code: Code: Copy Dim xui As XUI WebView1.LoadUrl(xui.FileUri(File.DirAssets, stringa)) Are you referencing other resources in this html string?
Giusy Active Member Licensed User Sep 3, 2018 #3 Hi @Erel, I tried the method you suggested, but the result is the same. In debug mode everything is ok while in release mode a blank page appears. With double-ckick on the white page, the same is automatically reduced in size. I have attached the two sample programs, mine and yours Thank you Attachments HtmlLoadUrl.zip HtmlLoadUrl.zip 5.5 KB · Views: 518 HtmlWithXUI.zip HtmlWithXUI.zip 5.5 KB · Views: 546 Upvote 0
Hi @Erel, I tried the method you suggested, but the result is the same. In debug mode everything is ok while in release mode a blank page appears. With double-ckick on the white page, the same is automatically reduced in size. I have attached the two sample programs, mine and yours Thank you
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2018 #4 My mistake. Check the documentation of LoadURL: https://www.b4x.com/b4i/help/views.html#webview_loadurl You cannot use it to load resources from the assets folder. Correct code: Code: Copy WebView1.LoadHtml(File.ReadString(File.DirAssets, "a1.html")) Upvote 0
My mistake. Check the documentation of LoadURL: https://www.b4x.com/b4i/help/views.html#webview_loadurl You cannot use it to load resources from the assets folder. Correct code: Code: Copy WebView1.LoadHtml(File.ReadString(File.DirAssets, "a1.html"))
Giusy Active Member Licensed User Sep 3, 2018 #5 Ah, very well @Erel Now it works perfectly. Thank you very much Upvote 0