B4J Question WebView margins

a n g l o

Active Member
Licensed User
Longtime User
hi,
i'm loading an htm file into a WebView using :
B4X:
wv.LoadUrl(xui.FileUri(File.DirApp,"1.htm"))
the content is automatically wrapped according to the WebView size. that's great.

the problem is that when a vertical scrollbar appears - it covers parts of the last letter in some lines :
1.jpg

any way to set a margin ?
Thanks,
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
Please,
Can you try this?

B4X:
Sub wv_PageFinished (Url As String)
   
    Dim script As String="document.getElementsByTagName('body')[0].style = 'padding-right: 50px';"
    Dim jo As JavaObject = wv
    jo.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array(script))

End Sub
 
Last edited:
Upvote 0
Top