iOS Question Webview Bodysize

Blueforcer

Well-Known Member
Licensed User
Longtime User
I want to show a very small gif (8x8) in a webview wich has a size of 100x100.
The GIF should have the same size as the webview, while it workw perfectly in B4A, in B4I the gif is much bigger and you need to scroll in all direction.
It seems like the engine doesnt know the acutal size of the webview.


B4X:
webview.LoadHtml($"<html><head><style>
        body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background-color: black; }
        img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
        </style></head><body>
        <img src="https://developer.lametric.com/content/apps/icon_thumbs/4584.gif"/>
        </body></html>"$)
 
Last edited:

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
I note that your HTML does not contain the viewport meta tag in the header.
Normally you would include
B4X:
<meta name=viewport content="width=device-width, initial-scale=1">

without it I find that the webview will not scale its contents correctly.
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
Thank you, it works.
Seems like android engine doesn't care about that, here it works without that
 
Upvote 0
Top