kisoft Well-Known Member Licensed User Longtime User Mar 23, 2020 #1 HI Internal WebView is now based on WKWebView. There is also a new EvaluateJavaScript method. There was a problem displaying text in the web view (HTML file). The text is much smaller than in the old web view. What should be done to ensure that the text is displayed correctly. I don't want to change the properties of HTML files, there are over 1000 of them.
HI Internal WebView is now based on WKWebView. There is also a new EvaluateJavaScript method. There was a problem displaying text in the web view (HTML file). The text is much smaller than in the old web view. What should be done to ensure that the text is displayed correctly. I don't want to change the properties of HTML files, there are over 1000 of them.
Semen Matusovskiy Well-Known Member Licensed User Mar 23, 2020 #2 Try to add <meta name="viewport" content="initial-scale=1.0" /> in header. Upvote 0
kisoft Well-Known Member Licensed User Longtime User Mar 23, 2020 #3 I load the text from an html file B4X: Copy WKWebView1.LoadHtml(File.ReadString(File.DirAssets,myfile.html)) Do I need to add this to every html file? Can I add it using code? ... but how do I do it? Upvote 0
I load the text from an html file B4X: Copy WKWebView1.LoadHtml(File.ReadString(File.DirAssets,myfile.html)) Do I need to add this to every html file? Can I add it using code? ... but how do I do it?
Semen Matusovskiy Well-Known Member Licensed User Mar 23, 2020 #4 For example, if you use low case in HTML: Code: Copy Dim s As String = File.ReadString(File.DirAssets,myfile.html) s = s.Replace ("<head>", $"<head> <meta name="viewport" content="initial-scale=1.0" />"$) WKWebView1.LoadHtml (s) Upvote 0
For example, if you use low case in HTML: Code: Copy Dim s As String = File.ReadString(File.DirAssets,myfile.html) s = s.Replace ("<head>", $"<head> <meta name="viewport" content="initial-scale=1.0" />"$) WKWebView1.LoadHtml (s)
kisoft Well-Known Member Licensed User Longtime User Mar 23, 2020 #5 Thank you for your help. It works as expected. Upvote 0