abhishek007p Active Member Licensed User Longtime User May 14, 2015 #1 Hi, i have a simple app which is uses webview to display a html page, in Debug build the html page appears fine but in release build, the webview is blank (white). i have already -cleaned up safari history in case that was causing problem. -placed a test button to reload the page instead of at app start. -checked if file exists or not, and it does exists. here is the code i am using to load the html page. Code: Copy WebView1.LoadUrl("file://" & File.Combine(File.DirAssets,"1.htm")) placed under Sub Application_Start Last edited: May 14, 2015
Hi, i have a simple app which is uses webview to display a html page, in Debug build the html page appears fine but in release build, the webview is blank (white). i have already -cleaned up safari history in case that was causing problem. -placed a test button to reload the page instead of at app start. -checked if file exists or not, and it does exists. here is the code i am using to load the html page. Code: Copy WebView1.LoadUrl("file://" & File.Combine(File.DirAssets,"1.htm")) placed under Sub Application_Start
omidaghakhani1368 Well-Known Member Licensed User Longtime User May 14, 2015 #2 Hi Use LoadHtml example : Code: Copy Webview1.LoadHtml(File.LoadString(File.DirAsset,"1.html")) Upvote 0
abhishek007p Active Member Licensed User Longtime User May 14, 2015 #3 LoadHtml is for loading HTML string not a file. https://www.b4x.com/b4i/help/views.html#webview Loadhtml works but very slow, my html page takes 3-4 secs to appear. dont know how to fix it, i have searched the forum and other are also having this problem. Last edited: May 14, 2015 Upvote 0
LoadHtml is for loading HTML string not a file. https://www.b4x.com/b4i/help/views.html#webview Loadhtml works but very slow, my html page takes 3-4 secs to appear. dont know how to fix it, i have searched the forum and other are also having this problem.
Erel B4X founder Staff member Licensed User Longtime User May 15, 2015 #4 LoadHtml just calls the native UIWebView API that loads an html string. Make sure that your string doesn't reference any non-local resources. Upvote 0
LoadHtml just calls the native UIWebView API that loads an html string. Make sure that your string doesn't reference any non-local resources.
abhishek007p Active Member Licensed User Longtime User May 15, 2015 #5 my html page has lots of non-english Unicode character and the take time to render if loading by string, but not in case of loading the html by file in debug mode. i am not referencing non-local files, all the images and css are added to the files tab. some other user suggested to copy the html to temp folder and then load it, is it fine to do it? Make sure that your string doesn't reference any non-local resources. Click to expand... My page do have two external links, one opens a link and other link is a mailto to send me a email. is it fine? Can you post a Obj-C code to load a html file in webview? Last edited: May 15, 2015 Upvote 0
my html page has lots of non-english Unicode character and the take time to render if loading by string, but not in case of loading the html by file in debug mode. i am not referencing non-local files, all the images and css are added to the files tab. some other user suggested to copy the html to temp folder and then load it, is it fine to do it? Make sure that your string doesn't reference any non-local resources. Click to expand... My page do have two external links, one opens a link and other link is a mailto to send me a email. is it fine? Can you post a Obj-C code to load a html file in webview?
Erel B4X founder Staff member Licensed User Longtime User May 17, 2015 #6 abhishek007p said: some other user suggested to copy the html to temp folder and then load it, is it fine to do it? Click to expand... It will not have any impact on the performance. abhishek007p said: Can you post a Obj-C code to load a html file in webview? Click to expand... It will also won't affect the performance. Upvote 0
abhishek007p said: some other user suggested to copy the html to temp folder and then load it, is it fine to do it? Click to expand... It will not have any impact on the performance. abhishek007p said: Can you post a Obj-C code to load a html file in webview? Click to expand... It will also won't affect the performance.