B bluedude Well-Known Member Licensed User Longtime User Dec 1, 2014 #1 Hi, I have a webview which contains markdown language. I need to show all text by default in a custom listview without having to zoom. Is there a way to measure the height of the content in a webview?
Hi, I have a webview which contains markdown language. I need to show all text by default in a custom listview without having to zoom. Is there a way to measure the height of the content in a webview?
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2014 #2 Try to inject JavaScript that gets the document height: http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript Upvote 0
Try to inject JavaScript that gets the document height: http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript
B bluedude Well-Known Member Licensed User Longtime User Dec 1, 2014 #3 That seems to be a tough workaround. I basically need an autosizing view that can display HTML/markdown. What I do now is adding it to a custom listview (as text) and then measuring the height of that but is does not work very well. Other suggestions which are easier? Upvote 0
That seems to be a tough workaround. I basically need an autosizing view that can display HTML/markdown. What I do now is adding it to a custom listview (as text) and then measuring the height of that but is does not work very well. Other suggestions which are easier?
KY Leng Active Member Licensed User Longtime User Feb 8, 2023 #4 Erel said: Try to inject JavaScript that gets the document height: http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript Click to expand... Could you give example? I am not good in Java. Upvote 0
Erel said: Try to inject JavaScript that gets the document height: http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript Click to expand... Could you give example? I am not good in Java.
teddybear Well-Known Member Licensed User Feb 8, 2023 #5 KY Leng said: Could you give example? I am not good in Java. Click to expand... Javasctipt is not java. you can get the document height using javaobject B4X: Copy Private Sub getWebDocHeight() as int Dim j as JavaObject = WebView1 return j.RunMethodJO("getEngine", Null).RunMethod("executeSctipt", Array("doucment.body.scrollHeight")) End Sub Upvote 0
KY Leng said: Could you give example? I am not good in Java. Click to expand... Javasctipt is not java. you can get the document height using javaobject B4X: Copy Private Sub getWebDocHeight() as int Dim j as JavaObject = WebView1 return j.RunMethodJO("getEngine", Null).RunMethod("executeSctipt", Array("doucment.body.scrollHeight")) End Sub