Android Question I can't modify the Padding of a WebView

Seneca

Active Member
Licensed User
Hi.

I have tried to modify the padding of a WebView using the designer, using code ( wvInfo.Padding = Array As Int (10dip, 10dip, 10dip, 10dip) ) and by calling the following routine:

B4X:
Sub setPadding(v As View, Left As Int, Top As Int, Right As Int, Bottom As Int)
    Dim jo = v As JavaObject
    jo.RunMethod("setPadding", Array As Object(Left, Top, Right, Bottom))
End Sub

In none of the cases does it work for me. I don't know if I'm leaving something behind or it's a WebView bug.

Greetings.
 

sorex

Expert
Licensed User
Longtime User
websites have their own margins and padding settings. you'll need to add it to your pages I guess.

or make your webview 98%x wide and .left=1%x and remove the border (if it has one)
 
Upvote 0

Seneca

Active Member
Licensed User
Hi,

Yes, this is what I'm doing (98%x wide and .left=1%x ).

But since the Webview has implemented the Padding property, I expected it to work (in addition to the margins of the website)

Regards.
 
Upvote 0
Top