B4J Question change webview fontsize

Bel

Member
Licensed User
Hi
I use below code to change fontsize of "<html><body><p id="pis">Hi i am programmer</p></body></html>

change fontsize :
B4X:
js.enginePut("doc",we.RunMethod("getDocument",Null))
js.evalString("doc.body.style.fontSize = ""50px"";")

but it not working
 

Daestrum

Expert
Licensed User
Longtime User
If you just want to change the scale of the font in the webview you can use
B4X:
....
Dim wv As JavaObject = WebView1   ' webview1 = your webview
      wv.RunMethod("setFontScale",Array(2.0))       ' where 2.0 is the scale factor ie double the size
....
 
Upvote 0
Top