tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

feat(android): webview content will fill up the whole Ti.UI.WebView by default #14099

Closed m1ga closed 1 week ago

m1ga commented 2 months ago

Fixes #14098

The Webview content is not filling up the whole space so it can be used with 100% values. If you use px values it will work. If you inspect the element before this PR you'll see it doesn't have a height:

Bildschirmfoto_20240829_225345 (it still renders the background color but the inner DOM elements can't handle % values).

After this PR it will fill up the whole webview (e.g. Ti.UI.FILL, nothing, or a number value) and the elements inside will respond to percentage values.

Bildschirmfoto_20240829_225547

Test

var w = Ti.UI.createWindow({});
var h = Ti.UI.createWebView({
    html: '<meta name="viewport" content="width=device-width, initial-scale=1"><body style="background-color:red">  <canvas style="width: 100%; height: 100%; background-color:blue"></canvas></body>'
});
w.add(h);
w.open();