B4J Question WebView Page Sizing using Viewport relative values

nobbi59

Active Member
Licensed User
Longtime User
Hello Community,

I am trying to display a Webpage in a WebView inside of my form. This Webview is part of my UI and has the full height and ca. 10% of the width of my form.

Im loading a page thats content is set to have 100vw / 100vh size. But the WebView doesnt seem to be able to interpret the relative sizing style options. If I set absolute px Values, the Websites content is rendered correct but with relative values viewport/%, only a part of the Website is visible.

Is there any workaround for this issue?

Im not using the pixel values because my form is resizable.
 

nobbi59

Active Member
Licensed User
Longtime User
Thanks for your help @alwaysbusy, but unfortunately its still not working.

@Erel Most of my layout is created with the designer but the webview is created at runtime based on an .ini file.

But I dont understand why WebView has this issue, WebKit seems to support it. Is this a known issue?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is this a known issue?
You are the first to report it. B4J WebView is a thin wrapper above JavaFX WebView. You can search Google for JavaFX WebView and this issue. I haven't found anything related.

Most of my layout is created with the designer but the webview is created at runtime based on an .ini file.
Unless it comes directly from a html string then it will be simpler to build the views programmatically.
 
Upvote 0

nobbi59

Active Member
Licensed User
Longtime User
Thanks @Erel for your help. I was wondering too about the fact that there is nearly nothing to find on goole about this.

But now ive tried a few things and found the solution (its pretty ridiculous)

My WebViews Height was set to have its Parents PrefHeight and this was set to -1. So I think this was setting my WebView to resize to the size of its HTML content.
 
Upvote 0
Top